def upgrade_available(name):
 version = None
 cmd = 'pkg list -Huv {0}'.format(name)
 lines = __salt__['cmd.run_stdout'](cmd).splitlines()
 if (not lines):
  return {}
 ret = {}
 for line in lines:
  ret[_ips_get_pkgname(line)] = _ips_get_pkgversion(line)
 return ret

def upgrade_available ( name ) : version = None cmd = 'pkg list -Huv {0}' . format ( name ) lines = __salt__ [ 'cmd.run_stdout' ] ( cmd ) . splitlines ( ) if ( not lines ) : return { } ret = { } for line in lines : ret [ _ips_get_pkgname ( line ) ] = _ips_get_pkgversion ( line ) return ret
check if there is an upgrade available for a certain package cli example: .