pip state respects upgrade, ignore_installed & force_reinstall flags

This commit is contained in:
mafro 2012-10-28 23:26:32 +00:00
parent f045052602
commit 959645dd5a

View File

@ -69,10 +69,11 @@ def installed(name,
ret['comment'] = 'Error installing \'{0}\': {1}'.format(name, err)
return ret
if name in pip_list:
ret['result'] = True
ret['comment'] = 'Package already installed'
return ret
if ignore_installed == False and name in pip_list:
if force_reinstall == False and upgrade == False:
ret['result'] = True
ret['comment'] = 'Package already installed'
return ret
if __opts__['test']:
ret['result'] = None