Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
02477eef
Commit
02477eef
authored
Feb 27, 2014
by
Gareth Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue 5621, rpm_key doesn't work for el5
parent
ccb64e63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
library/packaging/rpm_key
+5
-3
No files found.
library/packaging/rpm_key
View file @
02477eef
...
@@ -131,7 +131,9 @@ class RpmKey:
...
@@ -131,7 +131,9 @@ class RpmKey:
def
normalize_keyid
(
self
,
keyid
):
def
normalize_keyid
(
self
,
keyid
):
"""Ensure a keyid doesn't have a leading 0x, has leading or trailing whitespace, and make sure is lowercase"""
"""Ensure a keyid doesn't have a leading 0x, has leading or trailing whitespace, and make sure is lowercase"""
ret
=
keyid
.
strip
()
.
lower
()
ret
=
keyid
.
strip
()
.
lower
()
if
ret
.
startswith
((
'0x'
,
'0X'
)):
if
ret
.
startswith
(
'0x'
):
return
ret
[
2
:]
elif
ret
.
startswith
(
'0X'
):
return
ret
[
2
:]
return
ret
[
2
:]
else
:
else
:
return
ret
return
ret
...
@@ -141,9 +143,9 @@ class RpmKey:
...
@@ -141,9 +143,9 @@ class RpmKey:
stdout
,
stderr
=
self
.
execute_command
([
gpg
,
'--no-tty'
,
'--batch'
,
'--with-colons'
,
'--fixed-list-mode'
,
'--list-packets'
,
keyfile
])
stdout
,
stderr
=
self
.
execute_command
([
gpg
,
'--no-tty'
,
'--batch'
,
'--with-colons'
,
'--fixed-list-mode'
,
'--list-packets'
,
keyfile
])
for
line
in
stdout
.
splitlines
():
for
line
in
stdout
.
splitlines
():
line
=
line
.
strip
()
line
=
line
.
strip
()
if
line
.
startswith
(
'
keyid
:'
):
if
line
.
startswith
(
'
:signature packet
:'
):
# We want just the last 8 characters of the keyid
# We want just the last 8 characters of the keyid
keyid
=
line
.
split
(
':'
)[
1
]
.
strip
()[
8
:]
keyid
=
line
.
split
(
)[
-
1
]
.
strip
()[
8
:]
return
keyid
return
keyid
self
.
json_fail
(
msg
=
"Unexpected gpg output"
)
self
.
json_fail
(
msg
=
"Unexpected gpg output"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment