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):
24 scheme = cfg["scheme"]
25 if scheme in self.saved:
27 self.instance = self.saved[scheme]
29 mgr = stevedore.driver.DriverManager(namespace="env_build.plugins",
32 self.instance = mgr.driver()
33 self.saved[scheme] = self.instance
36 return self.instance.build(cfg)
44 if __name__ == "__main__":
46 from vstf.controller.env_build.env_build import IntentParser
48 parser = argparse.ArgumentParser()
49 parser.add_argument('--config', help='config file to parse')
50 args = parser.parse_args()
51 logging.basicConfig(level=logging.INFO)
52 parser = IntentParser(args.config)
53 cfg_intent = parser.parse_cfg_file()
54 for host_cfg in cfg_intent['env-build']: