def set_prod_state(prod_state, device=None):
 if (not device):
  device = __salt__['grains.get']('fqdn')
 device_object = find_device(device)
 if (not device_object):
  return 'Unable to find a device in Zenoss for {0}'.format(device)
 log.info('Setting prodState to %d on %s device', prod_state, device)
 data = dict(uids=[device_object['uid']], prodState=prod_state, hashcheck=device_object['hash'])
 return _router_request('DeviceRouter', 'setProductionState', [data])

def set_prod_state ( prod_state , device = None ) : if ( not device ) : device = __salt__ [ 'grains.get' ] ( 'fqdn' ) device_object = find_device ( device ) if ( not device_object ) : return 'Unable to find a device in Zenoss for {0}' . format ( device ) log . info ( 'Setting prodState to %d on %s device' , prod_state , device ) data = dict ( uids = [ device_object [ 'uid' ] ] , prodState = prod_state , hashcheck = device_object [ 'hash' ] ) return _router_request ( 'DeviceRouter' , 'setProductionState' , [ data ] )
a function to set the prod_state in zenoss .