Pylinted nova-manage
This commit is contained in:
@@ -58,7 +58,6 @@ import gettext
|
|||||||
import glob
|
import glob
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -66,11 +65,11 @@ import IPy
|
|||||||
|
|
||||||
# If ../nova/__init__.py exists, add ../ to Python search path, so that
|
# If ../nova/__init__.py exists, add ../ to Python search path, so that
|
||||||
# it will override what happens to be installed in /usr/(local/)lib/python...
|
# it will override what happens to be installed in /usr/(local/)lib/python...
|
||||||
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
|
||||||
os.pardir,
|
os.pardir,
|
||||||
os.pardir))
|
os.pardir))
|
||||||
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
||||||
sys.path.insert(0, possible_topdir)
|
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||||
|
|
||||||
gettext.install('nova', unicode=1)
|
gettext.install('nova', unicode=1)
|
||||||
|
|
||||||
@@ -809,11 +808,11 @@ class VolumeCommands(object):
|
|||||||
class InstanceTypeCommands(object):
|
class InstanceTypeCommands(object):
|
||||||
"""Class for managing instance types / flavors."""
|
"""Class for managing instance types / flavors."""
|
||||||
|
|
||||||
def _print_instance_types(self, n, val):
|
def _print_instance_types(self, name, val):
|
||||||
deleted = ('', ', inactive')[val["deleted"] == 1]
|
deleted = ('', ', inactive')[val["deleted"] == 1]
|
||||||
print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, "
|
print ("%s: Memory: %sMB, VCPUS: %s, Storage: %sGB, FlavorID: %s, "
|
||||||
"Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB%s") % (
|
"Swap: %sGB, RXTX Quota: %sGB, RXTX Cap: %sMB%s") % (
|
||||||
n, val["memory_mb"], val["vcpus"], val["local_gb"],
|
name, val["memory_mb"], val["vcpus"], val["local_gb"],
|
||||||
val["flavorid"], val["swap"], val["rxtx_quota"],
|
val["flavorid"], val["swap"], val["rxtx_quota"],
|
||||||
val["rxtx_cap"], deleted)
|
val["rxtx_cap"], deleted)
|
||||||
|
|
||||||
@@ -1021,7 +1020,7 @@ class ImageCommands(object):
|
|||||||
machine_images[image_path] = image_metadata
|
machine_images[image_path] = image_metadata
|
||||||
else:
|
else:
|
||||||
other_images[image_path] = image_metadata
|
other_images[image_path] = image_metadata
|
||||||
except Exception as exc:
|
except Exception:
|
||||||
print _("Failed to load %(fn)s.") % locals()
|
print _("Failed to load %(fn)s.") % locals()
|
||||||
# NOTE(vish): do kernels and ramdisks first so images
|
# NOTE(vish): do kernels and ramdisks first so images
|
||||||
self._convert_images(other_images)
|
self._convert_images(other_images)
|
||||||
|
|||||||
Reference in New Issue
Block a user