Revision 7c4d6c7b lib/backend.py
b/lib/backend.py | ||
---|---|---|
141 | 141 |
master_netdev = cfg.GetMasterNetdev() |
142 | 142 |
master_ip = cfg.GetMasterIP() |
143 | 143 |
master_node = cfg.GetMasterNode() |
144 |
except errors.ConfigurationError, err:
|
|
144 |
except errors.ConfigurationError: |
|
145 | 145 |
logging.exception("Cluster configuration incomplete") |
146 | 146 |
return (None, None, None) |
147 | 147 |
return (master_netdev, master_ip, master_node) |
... | ... | |
573 | 573 |
try: |
574 | 574 |
names = hypervisor.GetHypervisor(hname).ListInstances() |
575 | 575 |
results.extend(names) |
576 |
except errors.HypervisorError, err:
|
|
576 |
except errors.HypervisorError: |
|
577 | 577 |
logging.exception("Error enumerating instances for hypevisor %s", hname) |
578 | 578 |
raise |
579 | 579 |
|
... | ... | |
918 | 918 |
# test every 10secs for 2min |
919 | 919 |
|
920 | 920 |
time.sleep(1) |
921 |
for dummy in range(11):
|
|
921 |
for _ in range(11):
|
|
922 | 922 |
if instance.name not in GetInstanceList([hv_name]): |
923 | 923 |
break |
924 | 924 |
time.sleep(10) |
... | ... | |
2024 | 2024 |
# but we don't have the owner here - maybe parse from existing |
2025 | 2025 |
# cache? for now, we only lose lvm data when we rename, which |
2026 | 2026 |
# is less critical than DRBD or MD |
2027 |
except errors.BlockDeviceError, err:
|
|
2027 |
except errors.BlockDeviceError: |
|
2028 | 2028 |
logging.exception("Can't rename device '%s' to '%s'", dev, unique_id) |
2029 | 2029 |
result = False |
2030 | 2030 |
return result |
... | ... | |
2109 | 2109 |
# deletes dir only if empty, otherwise we want to return False |
2110 | 2110 |
try: |
2111 | 2111 |
os.rmdir(file_storage_dir) |
2112 |
except OSError, err:
|
|
2112 |
except OSError: |
|
2113 | 2113 |
logging.exception("Cannot remove file storage directory '%s'", |
2114 | 2114 |
file_storage_dir) |
2115 | 2115 |
result = False, |
... | ... | |
2138 | 2138 |
if os.path.isdir(old_file_storage_dir): |
2139 | 2139 |
try: |
2140 | 2140 |
os.rename(old_file_storage_dir, new_file_storage_dir) |
2141 |
except OSError, err:
|
|
2141 |
except OSError: |
|
2142 | 2142 |
logging.exception("Cannot rename '%s' to '%s'", |
2143 | 2143 |
old_file_storage_dir, new_file_storage_dir) |
2144 | 2144 |
result = False, |
... | ... | |
2544 | 2544 |
dir_name = "%s/%s" % (self._BASE_DIR, subdir) |
2545 | 2545 |
try: |
2546 | 2546 |
dir_contents = utils.ListVisibleFiles(dir_name) |
2547 |
except OSError, err:
|
|
2547 |
except OSError: |
|
2548 | 2548 |
# FIXME: must log output in case of failures |
2549 | 2549 |
return rr |
2550 | 2550 |
|
... | ... | |
2667 | 2667 |
fdata = "%s %s %s\n" % (str(owner), state, iv_name) |
2668 | 2668 |
try: |
2669 | 2669 |
utils.WriteFile(fpath, data=fdata) |
2670 |
except EnvironmentError, err:
|
|
2670 |
except EnvironmentError: |
|
2671 | 2671 |
logging.exception("Can't update bdev cache for %s", dev_path) |
2672 | 2672 |
|
2673 | 2673 |
@classmethod |
... | ... | |
2689 | 2689 |
fpath = cls._ConvertPath(dev_path) |
2690 | 2690 |
try: |
2691 | 2691 |
utils.RemoveFile(fpath) |
2692 |
except EnvironmentError, err:
|
|
2692 |
except EnvironmentError: |
|
2693 | 2693 |
logging.exception("Can't update bdev cache for %s", dev_path) |
Also available in: Unified diff