示例#1
0
class SystemLocalDB(SystemAPI):

    def __init__(self, cfg, log=logging):
        # cfg.phantom.system.db_url
        self._db = LaunchConfigurationDB(cfg.phantom.system.db_url)
        self._log = log

    def create_launch_config(self, user_obj, lc):
        try:
            lco = LaunchConfigurationObject()
            lco.set_from_outtype(lc, user_obj)
            self._db.db_obj_add(lco)
            self._db.db_commit()
        except IntegrityError, ie:
            self._log.error("DB error %s" % (str(ie)))
            raise PhantomAWSException('InvalidParameterValue',details="Name already in use")
示例#2
0
 def __init__(self, cfg, log=logging):
     # cfg.phantom.system.db_url
     self._db = LaunchConfigurationDB(cfg.phantom.system.db_url)
     self._log = log