Misc pep8 fixes

This commit is contained in:
Michael DeHaan 2013-10-19 13:02:57 -04:00
parent c933a4c59a
commit 21d4400c96
5 changed files with 7 additions and 4 deletions

View file

@ -101,7 +101,7 @@ class Task(object):
utils.deprecated("The 'when_' conditional is a deprecated syntax as of 1.2. Switch to using the regular unified 'when' statements as described in ansibleworks.com/docs/.","1.5")
if 'when' in ds:
raise errors.AnsibleError("multiple when_* statements specified in task %s" % (ds.get('name', ds['action'])))
raise errors.AnsibleError("multiple when_* statements specified in task %s" % (ds.get('name', ds['action'])))
when_name = x.replace("when_","")
ds['when'] = "%s %s" % (when_name, ds[x])
ds.pop(x)

View file

@ -377,7 +377,8 @@ def main():
create_vm_template(c, vmname, image, zone)
module.exit_json(changed=True, msg="deployed VM %s from template %s" % (vmname,image))
elif resource_type == 'new':
create_vm(c, vmtype, vmname, zone, vmdisk_size, vmcpus, vmnic, vmnetwork, vmmem, vmdisk_alloc, sdomain, vmcores, vmos, vmdisk_int )
# FIXME: refactor, use keyword args.
create_vm(c, vmtype, vmname, zone, vmdisk_size, vmcpus, vmnic, vmnetwork, vmmem, vmdisk_alloc, sdomain, vmcores, vmos, vmdisk_int)
module.exit_json(changed=True, msg="deployed VM %s from scratch" % vmname)
else:
module.exit_json(changed=False, msg="You did not specify a resource type")

View file

@ -135,7 +135,7 @@ def generate_options_string(install_options):
if install_options is None:
return ''
options_str = ''
options_str = ''
for option in install_options:
options_str += ' --%s' % option

View file

@ -880,7 +880,7 @@ class NetBsdService(Service):
if os.path.isfile(rcfile):
self.rcconf_file = rcfile
self.rcconf_key = "%s" % string.replace(self.name,"-","_");
self.rcconf_key = "%s" % string.replace(self.name,"-","_")
return self.service_enable_rcconf()

View file

@ -168,6 +168,7 @@ def daemonize_self(module, password, port, minutes):
log("daemonizing successful")
class ThreadWithReturnValue(Thread):
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None):
Thread.__init__(self, group, target, name, args, kwargs, Verbose)
self._return = None
@ -176,6 +177,7 @@ class ThreadWithReturnValue(Thread):
if self._Thread__target is not None:
self._return = self._Thread__target(*self._Thread__args,
**self._Thread__kwargs)
def join(self,timeout=None):
Thread.join(self, timeout=timeout)
return self._return