type=str, required=True, help= 'Please provide solId for which a solution Component needs to be added.' ) parser.add_argument( '-e', '--env', type=str, required=True, choices=['Production', 'Development', 'Quality', 'Other'], help='Select environment (Production, Development, Quality, Other)') args = parser.parse_args() cfg = my_env.init_env("bellavista", __file__) mdb = murcsstore.Murcs(cfg) r = murcsrest.MurcsRest(cfg) logging.info("Arguments: {a}".format(a=args)) solId = args.solId sol_rec = mdb.get_sol(solId) if not sol_rec: sys.exit("Solution {solId} not found.".format(solId=solId)) solInstId = my_env.get_solInstId(solId, args.env) solInst_rec = mdb.get_solComp(solInstId) if solInst_rec: sys.exit("Solution Component {solInstId} exists, not created.".format( solInstId=solInstId)) else: r.add_solutionComponent(sol_rec, args.env) mdb.close()
required=True, help='Please provide solId to identify the application.') parser.add_argument( '-e', '--env', type=str, required=True, choices=['Production', 'Development', 'Quality', 'Other'], help= 'Please provide environment (Production, Quality, Development, Other)') args = parser.parse_args() cfg = my_env.init_env("bellavista", __file__) mdb = murcsstore.Murcs(cfg) r = murcsrest.MurcsRest(cfg) logging.info("Arguments: {a}".format(a=args)) solInstId = my_env.get_solInstId(solId=args.solId, env=args.env) hostName = args.hostName solcomp_rec = mdb.get_solComp(solInstId) server_rec = mdb.get_server(hostName) if not solcomp_rec: sys.exit("Solution Component {solInstId} not found.".format( solInstId=solInstId)) if not server_rec: sys.exit("Server {h} not found.".format(h=hostName)) serverId = server_rec["serverId"] solId = solcomp_rec["solId"] environment = solcomp_rec["environment"] # Handle Software for the Solution softId = "{solId} software".format(solId=solId) if not mdb.get_soft(softId): r.add_software_from_sol(solcomp_rec)
'--env', type=str, required=True, choices=['Production', 'Development', 'Quality', 'Other'], help= 'Please provide environment (Production, Quality, Development, Other)') args = parser.parse_args() cfg = my_env.init_env("bellavista", __file__) lcl = localstore.sqliteUtils(cfg) r = murcsrest.MurcsRest(cfg) logging.info("Arguments: {a}".format(a=args)) serverId = args.serverId solId = args.solId env = args.env solInstId = my_env.get_solInstId(solId=solId, env=env) solcomp_rec = lcl.get_solComp(solInstId) server_rec = lcl.get_server(serverId) if not solcomp_rec: sys.exit("Solution Component {solInstId} not found.".format( solInstId=solInstId)) if not server_rec: sys.exit("Server {h} not found.".format(h=serverId)) # Get all software instances from the server query = """ SELECT softinst.softwareInstanceId as instId, software.softwareId as softId FROM softinst INNER JOIN software ON software.softwareId=softinst.softwareId WHERE softinst.serverId="{srv}" """.format(srv=serverId)