예제 #1
0
    def start(self):

        self.log.debug("Registering with dts")

        try:
            super().start()

            self.dts = rift.tasklets.DTS(self.tasklet_info,
                                         RwLaunchpadYang.get_schema(),
                                         self.loop, self.on_dts_state_change)

            proxy = filesystem.FileSystemProxy(self.loop, self.log, self.dts)
            args = [self.log, self.dts, self.loop]

            args.append(proxy)
            self.endpoint_rpc = rpc.EndpointDiscoveryRpcHandler(*args)
            self.schema_rpc = rpc.SchemaRpcHandler(*args)
            self.delete_rpc = rpc.PackageDeleteOperationsRpcHandler(*args)

            args.append(self)
            self.pkg_op = rpc.PackageOperationsRpcHandler(*args)

            self.project_handler = ProjectHandler(
                self,
                PackageManagerProject,
                proxy=proxy,
            )
        except Exception as e:
            self.log.exception("Exception caught rwpkgmgr start: %s", str(e))
        else:
            self.log.debug("rwpkgmgr started successfully!")
예제 #2
0
        def on_prepare(xact_info, action, ks_path, msg):
            try:
                # Create a datacenters instance to hold all of the cloud
                # account data.
                datacenters = RwLaunchpadYang.DataCenters()

                # Iterate over the known openmano accounts and populate cloud
                # account instances with the corresponding data center info
                for account in self.accounts:
                    try:
                        cloud_account = RwLaunchpadYang.CloudAccount()
                        cloud_account.name = account.name

                        # Create a client for this cloud account to query for
                        # the associated data centers
                        client = openmano_client.OpenmanoCliAPI(
                            self.log,
                            account.openmano.host,
                            account.openmano.port,
                            account.openmano.tenant_id,
                        )

                        # Populate the cloud account with the data center info
                        for uuid, name in client.datacenter_list():
                            cloud_account.datacenters.append(
                                RwLaunchpadYang.DataCenter(
                                    uuid=uuid,
                                    name=name,
                                ))

                        datacenters.cloud_accounts.append(cloud_account)

                    except Exception as e:
                        self.log.exception(e)

                xact_info.respond_xpath(
                    RwDts.XactRspCode.MORE,
                    'D,/rw-launchpad:datacenters',
                    datacenters,
                )

                xact_info.respond_xpath(RwDts.XactRspCode.ACK)

            except Exception as e:
                self.log.exception(e)
                raise
예제 #3
0
    def start(self):
        super().start()

        self.log.debug("Registering with dts")

        self.dts = rift.tasklets.DTS(self.tasklet_info,
                                     RwLaunchpadYang.get_schema(), self.loop,
                                     self.on_dts_state_change)

        self.log.debug("Created DTS Api GI Object: %s", self.dts)
예제 #4
0
    def start(self):
        super(LaunchpadTasklet, self).start()
        self.log.info("Starting LaunchpadTasklet")

        self.log.debug("Registering with dts")
        self.dts = rift.tasklets.DTS(self.tasklet_info,
                                     rwlaunchpad.get_schema(), self.loop,
                                     self.on_dts_state_change)

        self.log.debug("Created DTS Api GI Object: %s", self.dts)
예제 #5
0
    def start(self):
        super(LaunchpadTasklet, self).start()
        self.log.info("Starting LaunchpadTasklet")

        self.log.debug("Registering with dts")
        self.dts = rift.tasklets.DTS(
                self.tasklet_info,
                rwlaunchpad.get_schema(),
                self.loop,
                self.on_dts_state_change
                )

        self.log.debug("Created DTS Api GI Object: %s", self.dts)
예제 #6
0
    def __init__(self, log, loop, launchpad, vm_pool_mgr, network_pool_mgr):
        self._log = log
        self._loop = loop
        self._launchpad = launchpad
        self._vm_pool_mgr = vm_pool_mgr
        self._network_pool_mgr = network_pool_mgr

        self._manager = None

        self._model = RwYang.Model.create_libncx()
        self._model.load_schema_ypbc(RwCloudYang.get_schema())
        self._model.load_schema_ypbc(RwBaseYang.get_schema())
        self._model.load_schema_ypbc(RwResourceMgrYang.get_schema())
        self._model.load_schema_ypbc(RwNsmYang.get_schema())
        self._model.load_schema_ypbc(RwConmanYang.get_schema())
        self._model.load_schema_ypbc(RwLaunchpadYang.get_schema())
        self._cloud_account = None
 def configure_schema(cls):
     return launchpadyang.get_schema()
예제 #8
0
 def get_cloud_account_msg(self):
     cloud_account = launchpadyang.YangData_RwProject_Project_CloudAccounts_CloudAccountList()
     cloud_account.name = "cloudy"
     cloud_account.account_type = "mock"
     cloud_account.mock.username = "******"
     return cloud_account
예제 #9
0
 def get_cloud_account_msg(self):
     cloud_account = launchpadyang.CloudAccount()
     cloud_account.name = "cloudy"
     cloud_account.account_type = "mock"
     cloud_account.mock.username = "******"
     return cloud_account