def uptodate(name, bin_env=None, user=None, cwd=None, use_vt=False):
 ret = {'name': name, 'changes': {}, 'result': False, 'comment': 'Failed to update.'}
 try:
  packages = __salt__['pip.list_upgrades'](bin_env=bin_env, user=user, cwd=cwd)
 except Exception as e:
  ret['comment'] = str(e)
  return ret
 if (not packages):
  ret['comment'] = 'System is already up-to-date.'
  ret['result'] = True
  return ret
 elif __opts__['test']:
  ret['comment'] = 'System update will be performed'
  ret['result'] = None
  return ret
 updated = __salt__['pip.upgrade'](bin_env=bin_env, user=user, cwd=cwd, use_vt=use_vt)
 if (updated.get('result') is False):
  ret.update(updated)
 elif updated:
  ret['changes'] = updated
  ret['comment'] = 'Upgrade successful.'
  ret['result'] = True
 else:
  ret['comment'] = 'Upgrade failed.'
 return ret

def uptodate ( name , bin_env = None , user = None , cwd = None , use_vt = False ) : ret = { 'name' : name , 'changes' : { } , 'result' : False , 'comment' : 'Failed to update.' } try : packages = __salt__ [ 'pip.list_upgrades' ] ( bin_env = bin_env , user = user , cwd = cwd ) except Exception as e : ret [ 'comment' ] = str ( e ) return ret if ( not packages ) : ret [ 'comment' ] = 'System is already up-to-date.' ret [ 'result' ] = True return ret elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'System update will be performed' ret [ 'result' ] = None return ret updated = __salt__ [ 'pip.upgrade' ] ( bin_env = bin_env , user = user , cwd = cwd , use_vt = use_vt ) if ( updated . get ( 'result' ) is False ) : ret . update ( updated ) elif updated : ret [ 'changes' ] = updated ret [ 'comment' ] = 'Upgrade successful.' ret [ 'result' ] = True else : ret [ 'comment' ] = 'Upgrade failed.' return ret
call the rest endpoint to see if the packages on the "server" are up to date .