Lint fixes

This commit is contained in:
Daniel Hobley 2016-02-01 14:50:13 +01:00
parent f701547027
commit 8598262d4e
3 changed files with 8 additions and 9 deletions

View File

@ -7,7 +7,6 @@ Install pkg, dmg and .app applications on Mac OS X minions.
# Import python libs
from __future__ import absolute_import
import os
import random
import logging
# Import salt libs

View File

@ -157,7 +157,7 @@ def installed(name, target="LocalSystem", dmg=False, store=False, app=False, mpk
if app:
if dmg:
# Run with python shell due to the wildcard
cmd = 'ls -d *.app'.format(real_pkg)
cmd = 'ls -d *.app'
out = __salt__['cmd.run'](cmd, cwd=mount_point, python_shell=True)
if '.app' not in out:
@ -201,13 +201,13 @@ def installed(name, target="LocalSystem", dmg=False, store=False, app=False, mpk
if app:
def failed_pkg(f_pkg):
ret['result'] = False
ret['comment'] += '{0} failed to install: {1}'.format(name, out)
ret['result'] = False
ret['comment'] += '{0} failed to install: {1}'.format(name, out)
if 'failed' in ret['changes']:
ret['changes']['failed'].append(f_pkg)
else:
ret['changes']['failed'] = [f_pkg]
if 'failed' in ret['changes']:
ret['changes']['failed'].append(f_pkg)
else:
ret['changes']['failed'] = [f_pkg]
for app in installing:
try:

View File

@ -190,7 +190,7 @@ class MacPackageTestCase(TestCase):
'''
expected = ['com.apple.this', 'com.salt.other']
mock = MagicMock(return_value='/tmp/dmg-X/file.pkg\n/tmp/dmg-X/other.pkg')
get_pkg_id_mock.side_effect=[['com.apple.this'], ['com.salt.other']]
get_pkg_id_mock.side_effect = [['com.apple.this'], ['com.salt.other']]
with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
out = macpackage.get_mpkg_ids('/path/to/file.mpkg')