Andrew Bogott has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/379286 )

Change subject: novastats: minor tweaks to the diskspace tool
......................................................................

novastats: minor tweaks to the diskspace tool

Change-Id: Ic2e406ead562179a7c4aafc53b2a54342468dbe7
---
M modules/openstack2/files/liberty/admin_scripts/novastats/diskspace.py
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/86/379286/1

diff --git 
a/modules/openstack2/files/liberty/admin_scripts/novastats/diskspace.py 
b/modules/openstack2/files/liberty/admin_scripts/novastats/diskspace.py
index d452ed9..c8af341 100755
--- a/modules/openstack2/files/liberty/admin_scripts/novastats/diskspace.py
+++ b/modules/openstack2/files/liberty/admin_scripts/novastats/diskspace.py
@@ -134,7 +134,10 @@
 
 novastrays = novaset - diskset
 if novastrays:
-    printstat("These instances are in nova but can't be found on disk: %s" % 
novastrays, True)
+    printstat("These instances are in nova but can't be found on disk:", True)
+    for instance in instances:
+        if instance.id in novastrays:
+            printstat("%s (%s)" % (instance.id, instance.status), True)
 
 for hostname in computenodedict.keys():
     hostdict = computenodedict[hostname]
@@ -145,7 +148,10 @@
     for instance in hostdict['instances'].keys():
         instance_space_on_disk += hostdict['instances'][instance]
 
-    accounted_for_space = instance_space_on_disk + hostdict['base']
+    if 'base' in hostdict:
+        accounted_for_space = instance_space_on_disk + hostdict['base']
+    else:
+        accounted_for_space = instance_space_on_disk
 
     noninstancespace = hostdict['duused'] - accounted_for_space
     printstat("Space in non-instance files: %sK" % noninstancespace, 
noninstancespace > ONEMEG)

-- 
To view, visit https://gerrit.wikimedia.org/r/379286
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2e406ead562179a7c4aafc53b2a54342468dbe7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to