Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Steve Wills
anchore
Commits
05f6119d
Commit
05f6119d
authored
Mar 08, 2017
by
Daniel Nurmi
Browse files
fix to handle transition between extra and base module output types during differencing
Signed-off-by:
Daniel Nurmi
nurmi@anchore.com>
parent
8f0d380a
Changes
1
Hide whitespace changes
Inline
Side-by-side
anchore/anchore_utils.py
View file @
05f6119d
...
...
@@ -1789,22 +1789,31 @@ def diff_images(imageId, baseimageId):
output
=
{}
adata
=
areport
[
module_name
][
module_value
][
module_type
]
bdata
=
breport
[
module_name
][
module_value
][
module_type
]
for
akey
in
adata
.
keys
():
if
akey
not
in
bdata
:
output
[
akey
]
=
"INIMG_NOTINBASE"
elif
adata
[
akey
]
!=
bdata
[
akey
]:
output
[
akey
]
=
"VERSION_DIFF"
for
bkey
in
bdata
.
keys
():
if
bkey
not
in
adata
:
output
[
bkey
]
=
"INBASE_NOTINIMG"
if
module_name
not
in
ret
:
ret
[
module_name
]
=
{}
if
module_value
not
in
ret
[
module_name
]:
ret
[
module_name
][
module_value
]
=
{}
ret
[
module_name
][
module_value
][
module_type
]
=
output
try
:
bdata
=
breport
[
module_name
][
module_value
][
module_type
]
except
:
for
btype
in
breport
[
module_name
][
module_value
].
keys
():
try
:
bdata
=
breport
[
module_name
][
module_value
][
btype
]
break
except
:
pass
if
adata
and
bdata
:
for
akey
in
adata
.
keys
():
if
akey
not
in
bdata
:
output
[
akey
]
=
"INIMG_NOTINBASE"
elif
adata
[
akey
]
!=
bdata
[
akey
]:
output
[
akey
]
=
"VERSION_DIFF"
for
bkey
in
bdata
.
keys
():
if
bkey
not
in
adata
:
output
[
bkey
]
=
"INBASE_NOTINIMG"
if
module_name
not
in
ret
:
ret
[
module_name
]
=
{}
if
module_value
not
in
ret
[
module_name
]:
ret
[
module_name
][
module_value
]
=
{}
ret
[
module_name
][
module_value
][
module_type
]
=
output
return
(
ret
)
...
...
Write
Preview
Supports
Markdown
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