def _property(methode, zone, key, value):
 ret = {'status': True}
 cfg_file = None
 if (methode not in ['set', 'clear']):
  ret['status'] = False
  ret['message'] = 'unkown methode {0}!'.format(methode)
 else:
  cfg_file = salt.utils.files.mkstemp()
  with salt.utils.fpopen(cfg_file, 'w+', mode=384) as fp_:
   if (methode == 'set'):
    fp_.write('{0} {1}={2}\n'.format(methode, key, value))
   elif (methode == 'clear'):
    fp_.write('{0} {1}\n'.format(methode, key))
 if cfg_file:
  res = __salt__['cmd.run_all']('zonecfg -z {zone} -f {path}'.format(zone=zone, path=cfg_file))
  ret['status'] = (res['retcode'] == 0)
  ret['message'] = (res['stdout'] if ret['status'] else res['stderr'])
  ret['message'] = ret['message'].replace('zonecfg: ', '')
  if (ret['message'] == ''):
   del ret['message']
  __salt__['file.remove'](cfg_file)
 return ret

def _property ( methode , zone , key , value ) : ret = { 'status' : True } cfg_file = None if ( methode not in [ 'set' , 'clear' ] ) : ret [ 'status' ] = False ret [ 'message' ] = 'unkown methode {0}!' . format ( methode ) else : cfg_file = salt . utils . files . mkstemp ( ) with salt . utils . fpopen ( cfg_file , 'w+' , mode = 384 ) as fp_ : if ( methode == 'set' ) : fp_ . write ( '{0} {1}={2}\n' . format ( methode , key , value ) ) elif ( methode == 'clear' ) : fp_ . write ( '{0} {1}\n' . format ( methode , key ) ) if cfg_file : res = __salt__ [ 'cmd.run_all' ] ( 'zonecfg -z {zone} -f {path}' . format ( zone = zone , path = cfg_file ) ) ret [ 'status' ] = ( res [ 'retcode' ] == 0 ) ret [ 'message' ] = ( res [ 'stdout' ] if ret [ 'status' ] else res [ 'stderr' ] ) ret [ 'message' ] = ret [ 'message' ] . replace ( 'zonecfg: ' , '' ) if ( ret [ 'message' ] == '' ) : del ret [ 'message' ] __salt__ [ 'file.remove' ] ( cfg_file ) return ret
internal handler for set and clear_property methode : string either set .