def _get_sk(**kwargs):
    '''
    Return sk
    '''
    config = _get_config(**kwargs)
    key = salt.utils.stringutils.to_str(config['sk'])
    sk_file = config['sk_file']
    if not key and sk_file:
        with salt.utils.files.fopen(sk_file, 'rb') as keyf:
            key = salt.utils.stringutils.to_unicode(keyf.read()).rstrip('\n')
    if key is None:
        raise Exception('no key or sk_file found')
    return base64.b64decode(key)
def _get_sk ( ** kwargs ) : config = _get_config ( ** kwargs ) key = salt . utils . stringutils . to_str ( config [ 'sk' ] ) sk_file = config [ 'sk_file' ] if not key and sk_file : with salt . utils . files . fopen ( sk_file , 'rb' ) as keyf : key = salt . utils . stringutils . to_unicode ( keyf . read ( ) ) . rstrip ( '\n' ) if key is None : raise Exception ( 'no key or sk_file found' ) return base64 . b64decode ( key )
Return sk