1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Minor style change: removed unnecessary dictionary

This commit is contained in:
David Stygstra 2013-10-13 12:35:53 -04:00
parent 4b4e0926bb
commit aa496e36a2
2 changed files with 8 additions and 8 deletions

View file

@ -92,19 +92,19 @@ class OVSBridge(object):
def run(self): def run(self):
'''Make the necessary changes''' '''Make the necessary changes'''
result = {'changed': False} changed = False
try: try:
if self.state == 'absent': if self.state == 'absent':
if self.exists(): if self.exists():
self.delete() self.delete()
result['changed'] = True changed = True
elif self.state == 'present': elif self.state == 'present':
if not self.exists(): if not self.exists():
self.add() self.add()
result['changed'] = True changed = True
except Exception, e: except Exception, e:
self.module.fail_json(msg=str(e)) self.module.fail_json(msg=str(e))
self.module.exit_json(**result) self.module.exit_json(changed=changed)
def main(): def main():

View file

@ -95,19 +95,19 @@ class OVSPort(object):
def run(self): def run(self):
'''Make the necessary changes''' '''Make the necessary changes'''
result = {'changed': False} changed = False
try: try:
if self.state == 'absent': if self.state == 'absent':
if self.exists(): if self.exists():
self.delete() self.delete()
result['changed'] = True changed = True
elif self.state == 'present': elif self.state == 'present':
if not self.exists(): if not self.exists():
self.add() self.add()
result['changed'] = True changed = True
except Exception, e: except Exception, e:
self.module.fail_json(msg=str(e)) self.module.fail_json(msg=str(e))
self.module.exit_json(**result) self.module.exit_json(changed=changed)
def main(): def main():