def setUp(self): self.agent = OpenCenterAgent( ['-c', 'tests/' 'opencenter-agent-test-working.conf'], 'test') self.output_handler = self.agent.output_handler self.input_handler = self.agent.input_handler self.result = self.agent.input_handler.fetch() self.result['output'] = self.output_handler.dispatch( self.result['input']) self.agent.input_handler.result(self.result) self.input_state = \ self.agent.input_handler.plugins['input']['state'] self.output_state = \ self.agent.output_handler.plugins['output']['state']
def setUp(self): self.agent = OpenCenterAgent( ['-c', 'tests/opencenter-agent-test-input' '-broken.conf'], 'test') self.output_handler = self.agent.output_handler self.input_handler = self.agent.input_handler self.result = self.agent.input_handler.fetch() # TODO: Make not suck plz try: self.result['output'] = self.output_handler.dispatch( self.result['input']) self.agent.input_handler.result(self.result) except KeyError: self.key_error = True self.input_state = \ self.agent.input_handler.plugins['input']['state'] self.output_state = \ self.agent.output_handler.plugins['output']['state']
# # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. This # version of OpenCenter includes Rackspace trademarks and logos, and in # accordance with Section 6 of the License, the provision of commercial # support services in conjunction with a version of OpenCenter which includes # Rackspace trademarks and logos is prohibited. OpenCenter source code and # details are available at: # https://github.com/rcbops/opencenter or upon # written request. # # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 and a copy, including this # notice, is available in the LICENSE file accompanying this software. # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the # specific language governing permissions and limitations # under the License. # ############################################################################## # # import sys from opencenteragent import OpenCenterAgent if __name__ == '__main__': opencenteragent = OpenCenterAgent(sys.argv[1:]) opencenteragent.dispatch()