#NEWLINE# def _setup_stack( self , ryn = 'manor' ) : #NEWLINE# #INDENT# '\n        Setup and return the LaneStack and Yard used by by channel when global\n        not already setup such as in salt-call to communicate to-from the minion\n\n        ' #NEWLINE# role = self . opts . get ( 'id' ) #NEWLINE# if ( not role ) : #NEWLINE# #INDENT# emsg = "Missing role('id') required to setup RAETReqChannel." #NEWLINE# log . error ( ( emsg + '\n' ) ) #NEWLINE# raise ValueError ( emsg ) #NEWLINE# #UNINDENT# kind = self . opts . get ( '__role' ) #NEWLINE# if ( kind not in kinds . APPL_KINDS ) : #NEWLINE# #INDENT# emsg = "Invalid application kind = '{0}' for RAETReqChannel." . format ( kind ) #NEWLINE# log . error ( ( emsg + '\n' ) ) #NEWLINE# raise ValueError ( emsg ) #NEWLINE# #UNINDENT# if ( kind in [ kinds . APPL_KIND_NAMES [ kinds . applKinds . master ] , kinds . APPL_KIND_NAMES [ kinds . applKinds . syndic ] ] ) : #NEWLINE# #INDENT# lanename = 'master' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( kind in [ kinds . APPL_KIND_NAMES [ kinds . applKinds . minion ] , kinds . APPL_KIND_NAMES [ kinds . applKinds . caller ] ] ) : #NEWLINE# #INDENT# lanename = '{0}_{1}' . format ( role , kind ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# emsg = "Unsupported application kind '{0}' for RAETReqChannel." . format ( kind ) #NEWLINE# log . error ( ( emsg + '\n' ) ) #NEWLINE# raise ValueError ( emsg ) #NEWLINE# #UNINDENT# #UNINDENT# name = ( 'channel' + nacling . uuid ( size = 18 ) ) #NEWLINE# stack = LaneStack ( name = name , lanename = lanename , sockdirpath = self . opts [ 'sock_dir' ] ) #NEWLINE# stack . Pk = raeting . PackKind . pack #NEWLINE# stack . addRemote ( RemoteYard ( stack = stack , name = ryn , lanename = lanename , dirpath = self . opts [ 'sock_dir' ] ) ) #NEWLINE# log . debug ( 'Created Channel Jobber Stack {0}\n' . format ( stack . name ) ) #NEWLINE# return stack