1
0
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:
AmartC
2016-08-03 13:58:45 -04:00
committed by Atomic Bot
parent cfb8e98c6d
commit 3be035f415
3 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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";