mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
PEP 8 cleanup. (#20789)
* PEP 8 E703 cleanup. * PEP 8 E701 cleanup. * PEP 8 E711 cleanup. * PEP 8 W191 and E101 cleanup.
This commit is contained in:
@@ -379,7 +379,7 @@ class AzureRMModuleBase(object):
|
||||
mod = importlib.import_module(module_name)
|
||||
for mod_class_name, mod_class_obj in inspect.getmembers(mod, predicate=inspect.isclass):
|
||||
dependencies[mod_class_name] = mod_class_obj
|
||||
self.log("dependencies: ");
|
||||
self.log("dependencies: ")
|
||||
self.log(str(dependencies))
|
||||
serializer = Serializer(classes=dependencies)
|
||||
return serializer.body(obj, class_name)
|
||||
|
||||
@@ -1169,9 +1169,12 @@ class AnsibleModule(object):
|
||||
|
||||
def _apply_operation_to_mode(self, user, operator, mode_to_apply, current_mode):
|
||||
if operator == '=':
|
||||
if user == 'u': mask = stat.S_IRWXU | stat.S_ISUID
|
||||
elif user == 'g': mask = stat.S_IRWXG | stat.S_ISGID
|
||||
elif user == 'o': mask = stat.S_IRWXO | stat.S_ISVTX
|
||||
if user == 'u':
|
||||
mask = stat.S_IRWXU | stat.S_ISUID
|
||||
elif user == 'g':
|
||||
mask = stat.S_IRWXG | stat.S_ISGID
|
||||
elif user == 'o':
|
||||
mask = stat.S_IRWXO | stat.S_ISVTX
|
||||
|
||||
# mask out u, g, or o permissions from current_mode and apply new permissions
|
||||
inverse_mask = mask ^ PERM_BITS
|
||||
@@ -2361,7 +2364,7 @@ class AnsibleModule(object):
|
||||
# No pipes are left to read but process is not yet terminated
|
||||
# Only then it is safe to wait for the process to be finished
|
||||
# NOTE: Actually cmd.poll() is always None here if rpipes is empty
|
||||
elif not rpipes and cmd.poll() == None:
|
||||
elif not rpipes and cmd.poll() is None:
|
||||
cmd.wait()
|
||||
# The process is terminated. Since no pipes to read from are
|
||||
# left, there is no need to call select() again.
|
||||
|
||||
@@ -2186,7 +2186,8 @@ class AIX(Hardware):
|
||||
# nfs or cifs based mount
|
||||
# in case of nfs if no mount options are provided on command line
|
||||
# add into fields empty string...
|
||||
if len(fields) < 8: fields.append("")
|
||||
if len(fields) < 8:
|
||||
fields.append("")
|
||||
self.facts['mounts'].append({'mount': fields[2],
|
||||
'device': '%s:%s' % (fields[0], fields[1]),
|
||||
'fstype' : fields[3],
|
||||
|
||||
Reference in New Issue
Block a user