mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Lint fixes
This commit is contained in:
parent
f701547027
commit
8598262d4e
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user