Exemple #1
0
    def set_default_site(self, site):
        """
        set default site infos
        :param site:
        :return:
        """
        self['site'] = site
        self['site_id'] = utils.get_id_from_urn(self['site']['urn'])
        self['site_uri'] = '/'.join([constant.SITE_URI, self['site_id']])

        self.site_uri_map = {'site_uri': self['site_uri']}
Exemple #2
0
    def set_default_site(self, site):
        """
        set default site infos
        :param site:
        :return:
        """
        self['site'] = site
        self['site_id'] = utils.get_id_from_urn(self['site']['urn'])
        self['site_uri'] = '/'.join([constant.SITE_URI, self['site_id']])

        self.site_uri_map = {'site_uri': self['site_uri']}
Exemple #3
0
    def _init_all_fc_dvs(self):
        """
        Send message to fc and get dvswitch info

        :return:
        """
        LOG.debug("loading dvs mapping ")
        result = {}
        data = self.get(self.site.dvswitchs_uri)
        if not data.get(constant.DVSWITCHS):
            raise fc_exc.DVSwitchNotFound()

        dvs = data.get(constant.DVSWITCHS)
        if dvs and len(dvs) > 0:
            for dvswitch in dvs:
                dvs_id = utils.get_id_from_urn(dvswitch.get('urn'))
                result[dvswitch["name"]] = dvs_id

        LOG.debug("init all fc dvs %s.", jsonutils.dumps(result))
        self.dvs_mapping = result
Exemple #4
0
    def _init_all_fc_dvs(self):
        """
        Send message to fc and get dvswitch info

        :return:
        """
        LOG.debug("loading dvs mapping ")
        result = {}
        data = self.get(self.site.dvswitchs_uri)
        if not data.get(constant.DVSWITCHS):
            raise fc_exc.DVSwitchNotFound()

        dvs = data.get(constant.DVSWITCHS)
        if dvs and len(dvs) > 0:
            for dvswitch in dvs:
                dvs_id = utils.get_id_from_urn(dvswitch.get('urn'))
                result[dvswitch["name"]] = dvs_id

        LOG.debug("init all fc dvs %s.", jsonutils.dumps(result))
        self.dvs_mapping = result