1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
14 LOG = logging.getLogger(__name__)
17 class PluginManager(object):
23 scheme = cfg["scheme"]
24 if scheme in self.saved:
26 self.instance = self.saved[scheme]
28 mgr = stevedore.driver.DriverManager(namespace="env_build.plugins",
31 self.instance = mgr.driver()
32 self.saved[scheme] = self.instance
35 return self.instance.build(cfg)
43 if __name__ == "__main__":
45 from vstf.controller.env_build.env_build import IntentParser
47 parser = argparse.ArgumentParser()
48 parser.add_argument('--config', help='config file to parse')
49 args = parser.parse_args()
50 logging.basicConfig(level=logging.INFO)
51 parser = IntentParser(args.config)
52 cfg_intent = parser.parse_cfg_file()
53 for host_cfg in cfg_intent['env-build']: