Skip to content

Commit 74982c5

Browse files
authored
Fix warning when setup cloudstack-common (#4523)
1 parent cd356c0 commit 74982c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

python/lib/cloud_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def check_kvm():
301301
except CalledProcessError:
302302
raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
303303
except OSError as e:
304-
if e.errno is errno.ENOENT: raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
304+
if e.errno == errno.ENOENT: raise CheckFailed("KVM is not correctly installed on this system, or support for it is not enabled in the BIOS")
305305
raise
306306
return True
307307
raise AssertionError("check_kvm() should have never reached this part")
@@ -431,7 +431,7 @@ def done(self):
431431
alreadysetup = augtool.match("/files/etc/network/interfaces/iface",self.brname).stdout.strip()
432432
return alreadysetup
433433
except OSError as e:
434-
if e.errno is 2: raise TaskFailed("augtool has not been properly installed on this system")
434+
if e.errno == 2: raise TaskFailed("augtool has not been properly installed on this system")
435435
raise
436436

437437
def restore_state(self):
@@ -646,7 +646,7 @@ def done(self):
646646
try:
647647
return "group virt" in open("/etc/cgconfig.conf","r").read(-1)
648648
except IOError as e:
649-
if e.errno is 2: raise TaskFailed("cgconfig has not been properly installed on this system")
649+
if e.errno == 2: raise TaskFailed("cgconfig has not been properly installed on this system")
650650
raise
651651

652652
def execute(self):
@@ -672,7 +672,7 @@ def done(self):
672672
try:
673673
return self.cfgline in open("/etc/cgrules.conf","r").read(-1)
674674
except IOError as e:
675-
if e.errno is 2: raise TaskFailed("cgrulesd has not been properly installed on this system")
675+
if e.errno == 2: raise TaskFailed("cgrulesd has not been properly installed on this system")
676676
raise
677677

678678
def execute(self):
@@ -693,7 +693,7 @@ def done(self):
693693
try:
694694
return self.cfgline in open(self.filename,"r").read(-1)
695695
except IOError as e:
696-
if e.errno is 2: raise TaskFailed("qemu has not been properly installed on this system")
696+
if e.errno == 2: raise TaskFailed("qemu has not been properly installed on this system")
697697
raise
698698

699699
def execute(self):
@@ -712,7 +712,7 @@ def done(self):
712712
else: raise AssertionError("We should not reach this")
713713
return self.cfgline in open(libvirtfile,"r").read(-1)
714714
except IOError as e:
715-
if e.errno is 2: raise TaskFailed("libvirt has not been properly installed on this system")
715+
if e.errno == 2: raise TaskFailed("libvirt has not been properly installed on this system")
716716
raise
717717

718718
def execute(self):
@@ -742,7 +742,7 @@ def done(self):
742742
lines = [ s.strip() for s in open("/etc/libvirt/libvirtd.conf").readlines() ]
743743
if all( [ stanza in lines for stanza in self.stanzas ] ): return True
744744
except IOError as e:
745-
if e.errno is 2: raise TaskFailed("libvirt has not been properly installed on this system")
745+
if e.errno == 2: raise TaskFailed("libvirt has not been properly installed on this system")
746746
raise
747747

748748
def execute(self):

0 commit comments

Comments
 (0)