else '%s%%' % u.text for u in principals])
else:
uname = 'ALL'
- nopassword = entry.find('password') == None
+ nopassword = entry.find('password') is None
np_entry = ' NOPASSWD:' if nopassword else ''
p = '%s ALL=(%s)%s %s' % (uname, user, np_entry, command)
self.outf.write('%s\n' % p)
else '%s%%' % u.text for u in principals])
else:
uname = 'ALL'
- nopassword = e.find('password') == None
+ nopassword = e.find('password') is None
np_entry = ' NOPASSWD:' if nopassword else ''
p = '%s ALL=(%s)%s %s' % (uname, user, np_entry, command)
entries[p] = e
# if the attribute is not specified, try to use the old one
for attr_name, attr_value in attrs.items():
- if attr_value == None and attr_name in old_attrs:
+ if attr_value is None and attr_name in old_attrs:
attrs[attr_name] = str(old_attrs[attr_name])
# add '.' to initials if initals are not None and not "" and if the initials
else '%s%%' % u.text for u in principals])
else:
uname = 'ALL'
- nopassword = entry.find('password') == None
+ nopassword = entry.find('password') is None
np_entry = ' NOPASSWD:' if nopassword else ''
p = '%s ALL=(%s)%s %s' % (uname, user, np_entry, command)
attribute = b64encode(p.encode()).decode()
else '%s%%' % u.text for u in principals])
else:
uname = 'ALL'
- nopassword = entry.find('password') == None
+ nopassword = entry.find('password') is None
np_entry = ' NOPASSWD:' if nopassword else ''
p = '%s ALL=(%s)%s %s' % (uname, user, np_entry, command)
if str(self) not in output.keys():
errors = []
count = 0
for line in file_contents:
- if line == None or line == '\t' or line == "" or line == '\n':
+ if line is None or line == '\t' or line == "" or line == '\n':
continue
content = line.strip().split(None,1)
# start new error definition ?
if len(errors) == 0:
continue
err = errors[-1]
- if err.err_define == None:
+ if err.err_define is None:
err.err_define = transformErrorFunction(content[0])
else:
if len(content) > 0:
print("Error parsing file as line %d"%count)
sys.exit()
err = Errors[-1]
- if err.err_define == None:
+ if err.err_define is None:
err.err_define = "HRES_" + content[0]
else:
if len(content) > 0: