Пример #1
0
    def wrapped( topology_params, function_params, ssh = None, response = None, *args, **kwargs ):

        response                    	= HTTPOk()
        response.information_message    = ''
        response.execution              = { 
                                           HAS_BEEN_EXECUTED 	: False, 
                                           STEPS		: [],
                                          }
        response.next                  	= {}
        response.datas                  = []
        response.accepted_commands      = []
        response.is_ok                  = False

	if len( topology_params.aera ) != 2:

            remote_server_name          	= '%s-%s-%s-%s-%s' % (
                topology_params.appcode,
                topology_params.env,
                topology_params.appcomp,
                topology_params.num_component,
                topology_params.aera
            )

	else:

            remote_server_name          	= '%s-%s-%s-%s%s' % (
                topology_params.appcode,
                topology_params.env,
                topology_params.aera,
                topology_params.appcomp,
                topology_params.num_component
            )

        try:

            f( 
                topology_params, 
                function_params, 
                connect( remote_server_name ),
                response, 
                *args, 
                **kwargs 
            )

        except NetworkError, e:
            # abnormal exit
            app_e = HTTPServiceUnavailable()
            app_e.information_message = e.message
            raise app_e