def sign_remote_certificate(argdic, **kwargs):
 if ('signing_policy' not in argdic):
  return 'signing_policy must be specified'
 if (not isinstance(argdic, dict)):
  argdic = ast.literal_eval(argdic)
 signing_policy = {}
 if ('signing_policy' in argdic):
  signing_policy = _get_signing_policy(argdic['signing_policy'])
  if (not signing_policy):
   return 'Signing policy {0} does not exist.'.format(argdic['signing_policy'])
  if isinstance(signing_policy, list):
   dict_ = {}
   for item in signing_policy:
    dict_.update(item)
   signing_policy = dict_
 if ('minions' in signing_policy):
  if ('__pub_id' not in kwargs):
   return 'minion sending this request could not be identified'
  if (not __salt__['match.glob'](signing_policy['minions'], kwargs['__pub_id'])):
   return '{0} not permitted to use signing policy {1}'.format(kwargs['__pub_id'], argdic['signing_policy'])
 try:
  return create_certificate(path=None, text=True, **argdic)
 except Exception as except_:
  return str(except_)

def sign_remote_certificate ( argdic , ** kwargs ) : if ( 'signing_policy' not in argdic ) : return 'signing_policy must be specified' if ( not isinstance ( argdic , dict ) ) : argdic = ast . literal_eval ( argdic ) signing_policy = { } if ( 'signing_policy' in argdic ) : signing_policy = _get_signing_policy ( argdic [ 'signing_policy' ] ) if ( not signing_policy ) : return 'Signing policy {0} does not exist.' . format ( argdic [ 'signing_policy' ] ) if isinstance ( signing_policy , list ) : dict_ = { } for item in signing_policy : dict_ . update ( item ) signing_policy = dict_ if ( 'minions' in signing_policy ) : if ( '__pub_id' not in kwargs ) : return 'minion sending this request could not be identified' if ( not __salt__ [ 'match.glob' ] ( signing_policy [ 'minions' ] , kwargs [ '__pub_id' ] ) ) : return '{0} not permitted to use signing policy {1}' . format ( kwargs [ '__pub_id' ] , argdic [ 'signing_policy' ] ) try : return create_certificate ( path = None , text = True , ** argdic ) except Exception as except_ : return str ( except_ )
request a certificate to be remotely signed according to a signing policy .