mirror of
https://github.com/projectatomic/atomic.git
synced 2026-02-05 18:45:01 +01:00
Handle cases where container does not have a Status key
Minor fixes in scan Closes: #512 Approved by: rhatdan
This commit is contained in:
@@ -170,10 +170,11 @@ class Scan(Atomic):
|
||||
def gen_containers():
|
||||
slist = []
|
||||
for con in self.get_containers():
|
||||
if con['Status'].upper() != 'DEAD':
|
||||
# If con does not have 'Status' return empty string
|
||||
if con.get('Status', '').upper() != 'DEAD':
|
||||
con['input'] = con['Id']
|
||||
else:
|
||||
raise ValueError("The container ID {} is Dead and therefor cannot be scanned.".format(con['Id'][:12]))
|
||||
raise ValueError("The container ID {} is Dead.".format(con['Id'][:12]))
|
||||
slist.append(con)
|
||||
return slist
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ class SystemContainers(object):
|
||||
|
||||
util.write_out("Extracting to %s" % destination)
|
||||
|
||||
if 'display' in self.args and self.args.display:
|
||||
if hasattr(self.args, 'display') and self.args.display:
|
||||
return
|
||||
|
||||
if extract_only:
|
||||
@@ -348,7 +348,7 @@ class SystemContainers(object):
|
||||
repo.create(OSTree.RepoMode.BARE_USER)
|
||||
else:
|
||||
repo.create(OSTree.RepoMode.BARE)
|
||||
|
||||
|
||||
repo.open(None)
|
||||
return repo
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ require([
|
||||
var text = "Repository Last Scanned\n";
|
||||
call.done(function(result) {
|
||||
response = JSON.parse(result);
|
||||
for (var i = 2; i < response.length; i++) {
|
||||
for (var i = 0; i < response.length; i++) {
|
||||
text += response[i]["repo"] + " ";
|
||||
var checkbox = document.createElement('input');
|
||||
checkbox.type = "checkbox";
|
||||
|
||||
Reference in New Issue
Block a user