Commit aa496e36 by David Stygstra

Minor style change: removed unnecessary dictionary

parent 4b4e0926
...@@ -92,19 +92,19 @@ class OVSBridge(object): ...@@ -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():
......
...@@ -95,19 +95,19 @@ class OVSPort(object): ...@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment