Skip to content

Commit

Permalink
Misc changes
Browse files Browse the repository at this point in the history
Signed-off-by: Qin Zhang (张琴) <qin.zhang@citrix.com>
  • Loading branch information
qinz0822 committed Nov 3, 2023
1 parent eb7eccc commit 0cb382b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions XSConsoleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def DataCache(self):
def GetData(self, inNames, inDefault = None):
data = self.data
for name in inNames:
if name is '__repr__':
if name == '__repr__':
# Error - missing ()
raise Exception('Data call Data.' + '.'.join(inNames[:-1]) + ' must end with ()')
elif name in data:
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def IsXAPIRunning(self):
pidfile = "/var/run/xapi.pid"
if pidfile:
# Look for any "xapi" running
pid = file(pidfile).read().strip()
pid = open(pidfile, "r").read().strip()
exelink = "/proc/%s/exe" % (pid)
if os.path.exists(exelink):
if os.path.basename(os.readlink(exelink)) == "xapi":
Expand Down
2 changes: 1 addition & 1 deletion XSConsoleUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def ValidateIP(cls, text):
for i in ints:
if i > 255: return False
largest = max(largest, i)
if largest is 0: return False
if largest == 0: return False
return True

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion simpleconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def uppercase_ASCII_string(str):
newstr = ""
for i in range(0, len(str)):
if str[i] in string.lowercase:
if str[i].islower():
newstr += chr(ord(str[i]) - 32)
else:
newstr += str[i]
Expand Down

0 comments on commit 0cb382b

Please sign in to comment.