mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Use 'except ... as' syntax in contrib/ and test/ too
This commit is contained in:
@@ -175,5 +175,5 @@ if __name__ == '__main__':
|
||||
filters = {"tag:Name":opts.match_re.replace('^',''), "instance-state-name": ['running', 'pending', 'stopped' ]}
|
||||
delete_aws_instances(aws.get_all_instances(filters=filters), opts)
|
||||
|
||||
except KeyboardInterrupt, e:
|
||||
except KeyboardInterrupt as e:
|
||||
print "\nExiting on user command."
|
||||
|
||||
@@ -73,5 +73,5 @@ if __name__ == '__main__':
|
||||
delete_gce_resources(get_snapshots, 'name', opts)
|
||||
# Delete matching disks
|
||||
delete_gce_resources(gce.list_volumes, 'name', opts)
|
||||
except KeyboardInterrupt, e:
|
||||
except KeyboardInterrupt as e:
|
||||
print "\nExiting on user command."
|
||||
|
||||
@@ -20,7 +20,7 @@ else:
|
||||
def createDaemon():
|
||||
try:
|
||||
pid = os.fork()
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
raise Exception, "%s [%d]" % (e.strerror, e.errno)
|
||||
|
||||
if (pid == 0):
|
||||
@@ -28,7 +28,7 @@ def createDaemon():
|
||||
|
||||
try:
|
||||
pid = os.fork()
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
raise Exception, "%s [%d]" % (e.strerror, e.errno)
|
||||
|
||||
if (pid == 0):
|
||||
|
||||
@@ -38,5 +38,5 @@ if __name__ == '__main__':
|
||||
gce.create_volume_snapshot(base_volume, name=prefix+'-snapshot')
|
||||
gce.create_volume(
|
||||
size=10, name=prefix+'-extra', location='us-central1-a')
|
||||
except KeyboardInterrupt, e:
|
||||
except KeyboardInterrupt as e:
|
||||
print "\nExiting on user command."
|
||||
|
||||
Reference in New Issue
Block a user