def gen_accept(id_, keysize=2048, force=False):
 id_ = clean.id(id_)
 ret = gen(id_, keysize)
 acc_path = os.path.join(__opts__['pki_dir'], 'minions', id_)
 if (os.path.isfile(acc_path) and (not force)):
  return {}
 with salt.utils.fopen(acc_path, 'w+') as fp_:
  fp_.write(ret['pub'])
 return ret

def gen_accept ( id_ , keysize = 2048 , force = False ) : id_ = clean . id ( id_ ) ret = gen ( id_ , keysize ) acc_path = os . path . join ( __opts__ [ 'pki_dir' ] , 'minions' , id_ ) if ( os . path . isfile ( acc_path ) and ( not force ) ) : return { } with salt . utils . fopen ( acc_path , 'w+' ) as fp_ : fp_ . write ( ret [ 'pub' ] ) return ret
generate a key pair then accept the public key .