Skip to content

Commit

Permalink
Fix PyLint C0103 on salt.modules.at. Refs saltstack#1775.
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Dec 28, 2012
1 parent 842a9b1 commit 12ce942
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions salt/modules/at.py
Expand Up @@ -24,17 +24,17 @@
# TODO: Refactor some of this module to remove the checks for binaries

# Tested on OpenBSD 5.0
bsd = ('OpenBSD', 'FreeBSD')
BSD = ('OpenBSD', 'FreeBSD')

# Known not to work
bad = ('Windows',)
BAD = ('Windows',)


def __virtual__():
'''
Most everything has the ability to support at(1)
'''
if __grains__['os'] in bad or not salt.utils.which('at'):
if __grains__['os'] in BAD or not salt.utils.which('at'):
return False
return 'at'

Expand Down Expand Up @@ -92,7 +92,7 @@ def atq(tag=None):
if __grains__['os_family'] == 'RedHat':
job, spec = line.split('\t')
specs = spec.split()
elif __grains__['os'] in bsd:
elif __grains__['os'] in BSD:
if line.startswith(' Rank'):
continue
else:
Expand Down Expand Up @@ -120,7 +120,7 @@ def atq(tag=None):
if tmp:
job_tag = tmp.groups()[0]

if __grains__['os'] in bsd:
if __grains__['os'] in BSD:
job = str(job)
else:
job = int(job)
Expand Down Expand Up @@ -179,7 +179,7 @@ def atrm(*args):
return ret


def at(*args, **kwargs):
def at(*args, **kwargs): # pylint: disable-msg=C0103
'''
Add a job to the queue.
Expand Down Expand Up @@ -234,7 +234,7 @@ def at(*args, **kwargs):

output = output.split()[1]

if __grains__['os'] in bsd:
if __grains__['os'] in BSD:
return atq(str(output))
else:
return atq(int(output))
Expand Down

0 comments on commit 12ce942

Please sign in to comment.