summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Leafe <ed@leafe.com>2010-12-31 07:04:40 -0600
committerEd Leafe <ed@leafe.com>2010-12-31 07:04:40 -0600
commitf0e4bed6f4bf4ab3835ecd3e54eb9d7ac21dd5f1 (patch)
treec86bbd0175eab5b6371060b725744841d50f7821
parentb097d5a247f95fac180c3270cb1f613edfa46523 (diff)
downloadnova-f0e4bed6f4bf4ab3835ecd3e54eb9d7ac21dd5f1.tar.gz
nova-f0e4bed6f4bf4ab3835ecd3e54eb9d7ac21dd5f1.tar.xz
nova-f0e4bed6f4bf4ab3835ecd3e54eb9d7ac21dd5f1.zip
fixed pep8 issues
-rw-r--r--nova/virt/xenapi/vmops.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index c46a881a8..20f5e0215 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -285,7 +285,7 @@ class VMOps(object):
def list_from_xenstore(self, vm, path):
"""Runs the xenstore-ls command to get a listing of all records
from 'path' downward. Returns a dict with the sub-paths as keys,
- and the value stored in those paths as values. If nothing is
+ and the value stored in those paths as values. If nothing is
found at that path, returns None.
"""
ret = self._make_xenstore_call('list_records', vm, path)
@@ -319,7 +319,8 @@ class VMOps(object):
at the specified location. A XenAPIPlugin.PluginError will be raised
if any error is encountered in the write process.
"""
- return self._make_xenstore_call('write_record', vm, path, {'value': json.dumps(value)})
+ return self._make_xenstore_call('write_record', vm, path,
+ {'value': json.dumps(value)})
def clear_xenstore(self, vm, path):
"""Deletes the VM's xenstore record for the specified path.
@@ -329,8 +330,8 @@ class VMOps(object):
def _make_xenstore_call(self, method, vm, path, addl_args={}):
"""Handles calls to the xenstore xenapi plugin."""
- return self._make_plugin_call('xenstore.py', method=method, vm=vm, path=path,
- addl_args=addl_args)
+ return self._make_plugin_call('xenstore.py', method=method, vm=vm,
+ path=path, addl_args=addl_args)
def _make_plugin_call(self, plugin, method, vm, path, addl_args={}):
"""Abstracts out the process of calling a method of a xenapi plugin.
@@ -375,7 +376,7 @@ class VMOps(object):
keys = [key_or_keys]
else:
keys = key_or_keys
- keys.sort(lambda x,y: cmp(y.count('/'), x.count('/')))
+ keys.sort(lambda x, y: cmp(y.count('/'), x.count('/')))
for key in keys:
if path:
keypath = "%s/%s" % (path, key)
@@ -383,9 +384,8 @@ class VMOps(object):
keypath = key
self._make_xenstore_call('delete_record', vm, keypath)
-
########################################################################
- ###### The following methods interact with the xenstore parameter
+ ###### The following methods interact with the xenstore parameter
###### record, not the live xenstore. They were created before I
###### knew the difference, and are left in here in case they prove
###### to be useful. They all have '_param' added to their method
@@ -403,13 +403,14 @@ class VMOps(object):
return data
def read_from_param_xenstore(self, instance_or_vm, keys=None):
- """Returns the xenstore parameter record data for the specified VM instance
- as a dict. Accepts an optional key or list of keys; if a value for 'keys'
- is passed, the returned dict is filtered to only return the values
- for those keys.
+ """Returns the xenstore parameter record data for the specified VM
+ instance as a dict. Accepts an optional key or list of keys; if a
+ value for 'keys' is passed, the returned dict is filtered to only
+ return the values for those keys.
"""
vm = self._get_vm_opaque_ref(instance_or_vm)
- data = self._session.call_xenapi_request('VM.get_xenstore_data', (vm, ))
+ data = self._session.call_xenapi_request('VM.get_xenstore_data',
+ (vm, ))
ret = {}
if keys is None:
keys = data.keys()
@@ -452,7 +453,8 @@ class VMOps(object):
else:
keys = key_or_keys
for key in keys:
- self._session.call_xenapi_request('VM.remove_from_xenstore_data', (vm, key))
+ self._session.call_xenapi_request('VM.remove_from_xenstore_data',
+ (vm, key))
def clear_param_xenstore(self, instance_or_vm):
"""Removes all data from the xenstore parameter record for this VM."""