"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cloudkitty/fetcher/gnocchi.py" between
cloudkitty-12.1.0.tar.gz and cloudkitty-13.0.0.tar.gz

About: OpenStack CloudKitty provides Rating-as-a-Service for OpenStack.
The "Victoria" series (latest release).

gnocchi.py  (cloudkitty-12.1.0):gnocchi.py  (cloudkitty-13.0.0)
skipping to change at line 16 skipping to change at line 16
# a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
# #
import requests
from gnocchiclient import auth as gauth from gnocchiclient import auth as gauth
from gnocchiclient import client as gclient from gnocchiclient import client as gclient
from keystoneauth1 import loading as ks_loading from keystoneauth1 import loading as ks_loading
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from cloudkitty.common import custom_session
from cloudkitty import fetcher from cloudkitty import fetcher
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
FETCHER_GNOCCHI_OPTS = 'fetcher_gnocchi' FETCHER_GNOCCHI_OPTS = 'fetcher_gnocchi'
fetcher_gnocchi_opts = ks_loading.get_auth_common_conf_options() fetcher_gnocchi_opts = ks_loading.get_auth_common_conf_options()
gfetcher_opts = [ gfetcher_opts = [
cfg.StrOpt('scope_attribute', cfg.StrOpt('scope_attribute',
default='project_id', default='project_id',
skipping to change at line 63 skipping to change at line 66
cfg.StrOpt( cfg.StrOpt(
'interface', 'interface',
default='internalURL', default='internalURL',
help='Endpoint URL type (for keystone auth only)', help='Endpoint URL type (for keystone auth only)',
), ),
cfg.StrOpt( cfg.StrOpt(
'region_name', 'region_name',
default='RegionOne', default='RegionOne',
help='Region Name', help='Region Name',
), ),
cfg.IntOpt(
'http_pool_maxsize',
default=requests.adapters.DEFAULT_POOLSIZE,
help='If the value is not defined, we use the value defined by '
'requests.adapters.DEFAULT_POOLSIZE',
)
] ]
cfg.CONF.register_opts(fetcher_gnocchi_opts, FETCHER_GNOCCHI_OPTS) cfg.CONF.register_opts(fetcher_gnocchi_opts, FETCHER_GNOCCHI_OPTS)
cfg.CONF.register_opts(gfetcher_opts, FETCHER_GNOCCHI_OPTS) cfg.CONF.register_opts(gfetcher_opts, FETCHER_GNOCCHI_OPTS)
ks_loading.register_session_conf_options( ks_loading.register_session_conf_options(
cfg.CONF, cfg.CONF,
FETCHER_GNOCCHI_OPTS) FETCHER_GNOCCHI_OPTS)
ks_loading.register_auth_conf_options( ks_loading.register_auth_conf_options(
cfg.CONF, cfg.CONF,
FETCHER_GNOCCHI_OPTS) FETCHER_GNOCCHI_OPTS)
skipping to change at line 105 skipping to change at line 114
adapter_options['region_name'] = CONF.fetcher_gnocchi.region_name adapter_options['region_name'] = CONF.fetcher_gnocchi.region_name
verify = True verify = True
if CONF.fetcher_gnocchi.cafile: if CONF.fetcher_gnocchi.cafile:
verify = CONF.fetcher_gnocchi.cafile verify = CONF.fetcher_gnocchi.cafile
elif CONF.fetcher_gnocchi.insecure: elif CONF.fetcher_gnocchi.insecure:
verify = False verify = False
self._conn = gclient.Client( self._conn = gclient.Client(
'1', '1',
session_options={'auth': auth_plugin, 'verify': verify}, session=custom_session.create_custom_session(
{'auth': auth_plugin, 'verify': verify},
CONF.fetcher_gnocchi.http_pool_maxsize),
adapter_options=adapter_options, adapter_options=adapter_options,
) )
def get_tenants(self): def get_tenants(self):
resources = [] resources = []
resource_types = CONF.fetcher_gnocchi.resource_types resource_types = CONF.fetcher_gnocchi.resource_types
for resource_type in resource_types: for resource_type in resource_types:
marker = None marker = None
while True: while True:
resources_chunk = self._conn.resource.list( resources_chunk = self._conn.resource.list(
 End of changes. 4 change blocks. 
1 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)