summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Dague <sdague@linux.vnet.ibm.com>2013-01-09 16:00:36 -0500
committerSean Dague <sdague@linux.vnet.ibm.com>2013-01-10 08:57:09 -0500
commit5fca1d9e97913af549adaef0827b189540fc87fa (patch)
tree2a090d66f2288a0972eec2a1c65e4cc2ddeaee1b
parent8143021bdb5ec10ea60a6613e29bdc9347701a04 (diff)
downloadnova-5fca1d9e97913af549adaef0827b189540fc87fa.tar.gz
nova-5fca1d9e97913af549adaef0827b189540fc87fa.tar.xz
nova-5fca1d9e97913af549adaef0827b189540fc87fa.zip
fix new N402 errors
fix the N402 errors that have slipped in in the last 48 hrs since starting this patch series. fix an N401 error that our scanner current can't find because it only looks for doc strings on classes and defs. this is the xeno's paradox of patch series, but we're getting close. Change-Id: I4a763bb4c812335d853eae05c72464f18ab93297
-rwxr-xr-xbin/nova-baremetal-deploy-helper20
-rw-r--r--doc/api_samples/all_extensions/extensions-get-resp.json4
-rw-r--r--doc/api_samples/all_extensions/extensions-get-resp.xml4
-rw-r--r--nova/api/openstack/compute/contrib/admin_networks.py2
-rw-r--r--nova/api/openstack/compute/contrib/os_networks.py2
-rw-r--r--nova/api/openstack/compute/contrib/server_password.py2
-rw-r--r--nova/availability_zones.py2
-rw-r--r--nova/db/api.py12
-rw-r--r--nova/db/sqlalchemy/api.py6
-rw-r--r--nova/db/sqlalchemy/models.py4
-rw-r--r--nova/tests/compute/test_compute.py2
-rw-r--r--nova/tests/test_db_api.py14
-rw-r--r--nova/virt/baremetal/pxe.py16
-rw-r--r--plugins/xenserver/networking/etc/xensource/scripts/novalib.py4
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py2
-rw-r--r--smoketests/base.py12
16 files changed, 53 insertions, 55 deletions
diff --git a/bin/nova-baremetal-deploy-helper b/bin/nova-baremetal-deploy-helper
index fa0a30d9e..f8a487d37 100755
--- a/bin/nova-baremetal-deploy-helper
+++ b/bin/nova-baremetal-deploy-helper
@@ -56,7 +56,7 @@ QUEUE = Queue.Queue()
# They are split for stub-out.
def discovery(portal_address, portal_port):
- """Do iSCSI discovery on portal"""
+ """Do iSCSI discovery on portal."""
utils.execute('iscsiadm',
'-m', 'discovery',
'-t', 'st',
@@ -66,7 +66,7 @@ def discovery(portal_address, portal_port):
def login_iscsi(portal_address, portal_port, target_iqn):
- """Login to an iSCSI target"""
+ """Login to an iSCSI target."""
utils.execute('iscsiadm',
'-m', 'node',
'-p', '%s:%s' % (portal_address, portal_port),
@@ -79,7 +79,7 @@ def login_iscsi(portal_address, portal_port, target_iqn):
def logout_iscsi(portal_address, portal_port, target_iqn):
- """Logout from an iSCSI target"""
+ """Logout from an iSCSI target."""
utils.execute('iscsiadm',
'-m', 'node',
'-p', '%s:%s' % (portal_address, portal_port),
@@ -90,7 +90,7 @@ def logout_iscsi(portal_address, portal_port, target_iqn):
def make_partitions(dev, root_mb, swap_mb):
- """Create partitions for root and swap on a disk device"""
+ """Create partitions for root and swap on a disk device."""
commands = ['o,w',
'n,p,1,,+%dM,t,1,83,w' % root_mb,
'n,p,2,,+%dM,t,2,82,w' % swap_mb,
@@ -106,13 +106,13 @@ def make_partitions(dev, root_mb, swap_mb):
def is_block_device(dev):
- """Check whether a device is block or not"""
+ """Check whether a device is block or not."""
s = os.stat(dev)
return stat.S_ISBLK(s.st_mode)
def dd(src, dst):
- """Execute dd from src to dst"""
+ """Execute dd from src to dst."""
utils.execute('dd',
'if=%s' % src,
'of=%s' % dst,
@@ -122,7 +122,7 @@ def dd(src, dst):
def mkswap(dev, label='swap1'):
- """Execute mkswap on a device"""
+ """Execute mkswap on a device."""
utils.execute('mkswap',
'-L', label,
dev,
@@ -131,7 +131,7 @@ def mkswap(dev, label='swap1'):
def block_uuid(dev):
- """Get UUID of a block device"""
+ """Get UUID of a block device."""
out, _ = utils.execute('blkid', '-s', 'UUID', '-o', 'value', dev,
run_as_root=True,
check_exit_code=[0])
@@ -219,7 +219,7 @@ def deploy(address, port, iqn, lun, image_path, pxe_config_path,
class Worker(threading.Thread):
- """Thread that handles requests in queue"""
+ """Thread that handles requests in queue."""
def __init__(self):
super(Worker, self).__init__()
@@ -250,7 +250,7 @@ class Worker(threading.Thread):
class BareMetalDeploy(object):
- """WSGI server for bare-metal deployment"""
+ """WSGI server for bare-metal deployment."""
def __init__(self):
self.worker = Worker()
diff --git a/doc/api_samples/all_extensions/extensions-get-resp.json b/doc/api_samples/all_extensions/extensions-get-resp.json
index 5f92c1366..42e86eadd 100644
--- a/doc/api_samples/all_extensions/extensions-get-resp.json
+++ b/doc/api_samples/all_extensions/extensions-get-resp.json
@@ -298,7 +298,7 @@
},
{
"alias": "os-admin-networks",
- "description": "Admin-only Network Management Extension",
+ "description": "Admin-only Network Management Extension.",
"links": [],
"name": "AdminNetworks",
"namespace": "http://docs.openstack.org/compute/ext/os-admin-networks/api/v1.1",
@@ -306,7 +306,7 @@
},
{
"alias": "os-networks",
- "description": "Tenant-based Network Management Extension",
+ "description": "Tenant-based Network Management Extension.",
"links": [],
"name": "OSNetworks",
"namespace": "http://docs.openstack.org/compute/ext/os-networks/api/v1.1",
diff --git a/doc/api_samples/all_extensions/extensions-get-resp.xml b/doc/api_samples/all_extensions/extensions-get-resp.xml
index 8f92b274b..ea0b45a12 100644
--- a/doc/api_samples/all_extensions/extensions-get-resp.xml
+++ b/doc/api_samples/all_extensions/extensions-get-resp.xml
@@ -126,13 +126,13 @@
<description>Allow multiple create in the Create Server v1.1 API.</description>
</extension>
<extension alias="os-admin-networks" updated="2011-12-23T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/os-admin-networks/api/v1.1" name="AdminNetworks">
- <description>Admin-only Network Management Extension</description>
+ <description>Admin-only Network Management Extension.</description>
</extension>
<extension alias="os-networks-associate" updated="2012-11-19T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/networks_associate/api/v2" name="NetworkAssociationSupport">
<description>Network association support.</description>
</extension>
<extension alias="os-networks" updated="2011-12-23T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/os-networks/api/v1.1" name="OSNetworks">
- <description>Tenant-based Network Management Extension</description>
+ <description>Tenant-based Network Management Extension.</description>
</extension>
<extension alias="os-quota-class-sets" updated="2012-03-12T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1" name="QuotaClasses">
<description>Quota classes management support.</description>
diff --git a/nova/api/openstack/compute/contrib/admin_networks.py b/nova/api/openstack/compute/contrib/admin_networks.py
index cdcee02d0..f5facd601 100644
--- a/nova/api/openstack/compute/contrib/admin_networks.py
+++ b/nova/api/openstack/compute/contrib/admin_networks.py
@@ -151,7 +151,7 @@ class AdminNetworkController(wsgi.Controller):
class Admin_networks(extensions.ExtensionDescriptor):
- """Admin-only Network Management Extension"""
+ """Admin-only Network Management Extension."""
name = "AdminNetworks"
alias = "os-admin-networks"
diff --git a/nova/api/openstack/compute/contrib/os_networks.py b/nova/api/openstack/compute/contrib/os_networks.py
index 61a9d3af6..4be0bd100 100644
--- a/nova/api/openstack/compute/contrib/os_networks.py
+++ b/nova/api/openstack/compute/contrib/os_networks.py
@@ -187,7 +187,7 @@ class NetworkController(object):
class Os_networks(extensions.ExtensionDescriptor):
- """Tenant-based Network Management Extension"""
+ """Tenant-based Network Management Extension."""
name = "OSNetworks"
alias = "os-networks"
diff --git a/nova/api/openstack/compute/contrib/server_password.py b/nova/api/openstack/compute/contrib/server_password.py
index b4b2e04a5..0fd620fb8 100644
--- a/nova/api/openstack/compute/contrib/server_password.py
+++ b/nova/api/openstack/compute/contrib/server_password.py
@@ -66,7 +66,7 @@ class ServerPasswordController(object):
class Server_password(extensions.ExtensionDescriptor):
- """Server password support"""
+ """Server password support."""
name = "ServerPassword"
alias = "os-server-password"
diff --git a/nova/availability_zones.py b/nova/availability_zones.py
index c08e029cf..cb5cce591 100644
--- a/nova/availability_zones.py
+++ b/nova/availability_zones.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-""" utilities for multiple APIs"""
+"""utilities for multiple APIs."""
from nova import db
from nova.openstack.common import cfg
diff --git a/nova/db/api.py b/nova/db/api.py
index 27bb6bf35..b16c7ac20 100644
--- a/nova/db/api.py
+++ b/nova/db/api.py
@@ -1622,32 +1622,32 @@ def instance_fault_get_by_instance_uuids(context, instance_uuids):
def action_start(context, values):
- """Start an action for an instance"""
+ """Start an action for an instance."""
return IMPL.action_start(context, values)
def action_finish(context, values):
- """Finish an action for an instance"""
+ """Finish an action for an instance."""
return IMPL.action_finish(context, values)
def actions_get(context, uuid):
- """Get all instance actions for the provided instance"""
+ """Get all instance actions for the provided instance."""
return IMPL.actions_get(context, uuid)
def action_get_by_id(context, uuid, action_id):
- """Get the action by id and given instance"""
+ """Get the action by id and given instance."""
return IMPL.action_get_by_id(context, uuid, action_id)
def action_event_start(context, values):
- """Start an event on an instance action"""
+ """Start an event on an instance action."""
return IMPL.action_event_start(context, values)
def action_event_finish(context, values):
- """Finish an event on an instance action"""
+ """Finish an event on an instance action."""
return IMPL.action_event_finish(context, values)
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index bb6dfc63a..adb8106c4 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -4595,7 +4595,7 @@ def actions_get(context, instance_uuid):
def action_get_by_id(context, instance_uuid, action_id):
- """Get the action by id and given instance"""
+ """Get the action by id and given instance."""
action = model_query(context, models.InstanceAction).\
filter_by(instance_uuid=instance_uuid).\
filter_by(id=action_id).\
@@ -4614,7 +4614,7 @@ def _action_get_by_request_id(context, instance_uuid, request_id,
def action_event_start(context, values):
- """Start an event on an instance action"""
+ """Start an event on an instance action."""
session = get_session()
with session.begin():
action = _action_get_by_request_id(context, values['instance_uuid'],
@@ -4634,7 +4634,7 @@ def action_event_start(context, values):
def action_event_finish(context, values):
- """Finish an event on an instance action"""
+ """Finish an event on an instance action."""
session = get_session()
with session.begin():
action = _action_get_by_request_id(context, values['instance_uuid'],
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 735ef56e2..95fa6313f 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -985,7 +985,7 @@ class InstanceFault(BASE, NovaBase):
class InstanceAction(BASE, NovaBase):
- """Track client actions on an instance"""
+ """Track client actions on an instance."""
__tablename__ = 'instance_actions'
id = Column(Integer, primary_key=True, nullable=False, autoincrement=True)
action = Column(String(255))
@@ -1001,7 +1001,7 @@ class InstanceAction(BASE, NovaBase):
class InstanceActionEvent(BASE, NovaBase):
- """Track events that occur during an InstanceAction"""
+ """Track events that occur during an InstanceAction."""
__tablename__ = 'instance_actions_events'
id = Column(Integer, primary_key=True, nullable=False, autoincrement=True)
event = Column(String(255))
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 460366833..c9cb797da 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -3475,7 +3475,7 @@ class ComputeTestCase(BaseTestCase):
db.instance_destroy(c, inst_uuid)
def test_rebuild_on_host_instance_exists(self):
- """Rebuild if instance exists raise an exception"""
+ """Rebuild if instance exists raise an exception."""
# creating testdata
c = self.context.elevated()
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py
index acc290991..7df28bfcb 100644
--- a/nova/tests/test_db_api.py
+++ b/nova/tests/test_db_api.py
@@ -540,7 +540,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(expected, instance_faults)
def test_instance_action_start(self):
- """Create an instance action"""
+ """Create an instance action."""
ctxt = context.get_admin_context()
uuid = str(stdlib_uuid.uuid4())
@@ -563,7 +563,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(ctxt.project_id, actions[0]['project_id'])
def test_instance_action_finish(self):
- """Create an instance action"""
+ """Create an instance action."""
ctxt = context.get_admin_context()
uuid = str(stdlib_uuid.uuid4())
@@ -593,7 +593,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(ctxt.project_id, actions[0]['project_id'])
def test_instance_actions_get_by_instance(self):
- """Ensure we can get actions by UUID"""
+ """Ensure we can get actions by UUID."""
ctxt1 = context.get_admin_context()
ctxt2 = context.get_admin_context()
uuid1 = str(stdlib_uuid.uuid4())
@@ -625,7 +625,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual('run_instance', actions[1]['action'])
def test_instance_action_get_by_instance_and_action(self):
- """Ensure we can get an action by instance UUID and action id"""
+ """Ensure we can get an action by instance UUID and action id."""
ctxt1 = context.get_admin_context()
ctxt2 = context.get_admin_context()
uuid1 = str(stdlib_uuid.uuid4())
@@ -657,7 +657,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(ctxt1.request_id, action['request_id'])
def test_instance_action_event_start(self):
- """Create an instance action event"""
+ """Create an instance action event."""
ctxt = context.get_admin_context()
uuid = str(stdlib_uuid.uuid4())
@@ -683,7 +683,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(start_time, events[0]['start_time'])
def test_instance_action_event_finish(self):
- """Finish an instance action event"""
+ """Finish an instance action event."""
ctxt = context.get_admin_context()
uuid = str(stdlib_uuid.uuid4())
@@ -717,7 +717,7 @@ class DbApiTestCase(test.TestCase):
self.assertEqual(finish_time, events[0]['finish_time'])
def test_instance_action_event_get_by_id(self):
- """Get a specific instance action event"""
+ """Get a specific instance action event."""
ctxt1 = context.get_admin_context()
ctxt2 = context.get_admin_context()
uuid1 = str(stdlib_uuid.uuid4())
diff --git a/nova/virt/baremetal/pxe.py b/nova/virt/baremetal/pxe.py
index f97126e72..b94ac9032 100644
--- a/nova/virt/baremetal/pxe.py
+++ b/nova/virt/baremetal/pxe.py
@@ -154,17 +154,17 @@ def get_deploy_ari_id(instance):
def get_image_dir_path(instance):
- """Generate the dir for an instances disk"""
+ """Generate the dir for an instances disk."""
return os.path.join(CONF.instances_path, instance['name'])
def get_image_file_path(instance):
- """Generate the full path for an instances disk"""
+ """Generate the full path for an instances disk."""
return os.path.join(CONF.instances_path, instance['name'], 'disk')
def get_pxe_config_file_path(instance):
- """Generate the path for an instances PXE config file"""
+ """Generate the path for an instances PXE config file."""
return os.path.join(CONF.baremetal.tftp_root, instance['uuid'], 'config')
@@ -185,7 +185,7 @@ def get_partition_sizes(instance):
def get_pxe_mac_path(mac):
- """Convert a MAC address into a PXE config file name"""
+ """Convert a MAC address into a PXE config file name."""
return os.path.join(
CONF.baremetal.tftp_root,
'pxelinux.cfg',
@@ -232,7 +232,7 @@ def get_tftp_image_info(instance):
class PXE(base.NodeDriver):
- """PXE bare metal driver"""
+ """PXE bare metal driver."""
def __init__(self):
super(PXE, self).__init__()
@@ -352,7 +352,7 @@ class PXE(base.NodeDriver):
def cache_images(self, context, node, instance,
admin_password, image_meta, injected_files, network_info):
- """Prepare all the images for this instance"""
+ """Prepare all the images for this instance."""
tftp_image_info = get_tftp_image_info(instance)
self._cache_tftp_images(context, instance, tftp_image_info)
@@ -361,7 +361,7 @@ class PXE(base.NodeDriver):
injected_files, admin_password)
def destroy_images(self, context, node, instance):
- """Delete instance's image file"""
+ """Delete instance's image file."""
bm_utils.unlink_without_raise(get_image_file_path(instance))
bm_utils.unlink_without_raise(get_image_dir_path(instance))
@@ -420,7 +420,7 @@ class PXE(base.NodeDriver):
bm_utils.create_link_without_raise(pxe_config_file_path, mac_path)
def deactivate_bootloader(self, context, node, instance):
- """Delete PXE bootloader images and config"""
+ """Delete PXE bootloader images and config."""
try:
image_info = get_tftp_image_info(instance)
except exception.NovaException:
diff --git a/plugins/xenserver/networking/etc/xensource/scripts/novalib.py b/plugins/xenserver/networking/etc/xensource/scripts/novalib.py
index dcbee3ded..0f88e52bb 100644
--- a/plugins/xenserver/networking/etc/xensource/scripts/novalib.py
+++ b/plugins/xenserver/networking/etc/xensource/scripts/novalib.py
@@ -22,7 +22,7 @@ import subprocess
def execute_get_output(*command):
- """Execute and return stdout"""
+ """Execute and return stdout."""
devnull = open(os.devnull, 'w')
command = map(str, command)
proc = subprocess.Popen(command, close_fds=True,
@@ -32,7 +32,7 @@ def execute_get_output(*command):
def execute(*command):
- """Execute without returning stdout"""
+ """Execute without returning stdout."""
devnull = open(os.devnull, 'w')
command = map(str, command)
proc = subprocess.Popen(command, close_fds=True,
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
index 5cfd32dbd..be873a7e8 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
@@ -38,7 +38,7 @@ pluginlib.configure_logging("xenstore")
class XenstoreError(pluginlib.PluginError):
- """Errors that occur when calling xenstore-* through subprocesses"""
+ """Errors that occur when calling xenstore-* through subprocesses."""
def __init__(self, cmd, return_code, stderr, stdout):
msg = "cmd: %s; returncode: %d; stderr: %s; stdout: %s"
diff --git a/smoketests/base.py b/smoketests/base.py
index 69222878b..f6cec3168 100644
--- a/smoketests/base.py
+++ b/smoketests/base.py
@@ -63,7 +63,7 @@ class SmokeTestCase(unittest.TestCase):
return status == 0
def wait_for_running(self, instance, tries=60, wait=1):
- """Wait for instance to be running"""
+ """Wait for instance to be running."""
for x in xrange(tries):
instance.update()
if instance.state.startswith('running'):
@@ -73,7 +73,7 @@ class SmokeTestCase(unittest.TestCase):
return False
def wait_for_deleted(self, instance, tries=60, wait=1):
- """Wait for instance to be deleted"""
+ """Wait for instance to be deleted."""
for x in xrange(tries):
try:
#NOTE(dprince): raises exception when instance id disappears
@@ -85,7 +85,7 @@ class SmokeTestCase(unittest.TestCase):
return False
def wait_for_ping(self, ip, command="ping", tries=120):
- """Wait for ip to be pingable"""
+ """Wait for ip to be pingable."""
for x in xrange(tries):
if self.can_ping(ip, command):
return True
@@ -93,7 +93,7 @@ class SmokeTestCase(unittest.TestCase):
return False
def wait_for_ssh(self, ip, key_name, tries=30, wait=5):
- """Wait for ip to be sshable"""
+ """Wait for ip to be sshable."""
for x in xrange(tries):
try:
conn = self.connect_ssh(ip, key_name)
@@ -141,9 +141,7 @@ class SmokeTestCase(unittest.TestCase):
**kwargs)
def split_clc_url(self, clc_url):
- """
- Splits a cloud controller endpoint url.
- """
+ """Splits a cloud controller endpoint url."""
parts = httplib.urlsplit(clc_url)
is_secure = parts.scheme == 'https'
ip, port = parts.netloc.split(':')