Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
keystone ldap version debugging 06-01-2018
root@juju-0a91d2-0:/var/lib/juju/agents/unit-keystone-ldap-0/charm# ipdb3 hooks/install
> /var/lib/juju/agents/unit-keystone-ldap-0/charm/hooks/install(4)<module>()
3 # Load modules from $JUJU_CHARM_DIR/lib
----> 4 import sys
5 sys.path.append('lib')
ipdb> c
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms_openstack/charm/defaults.py(99)default_select_release()
-> release_version = unitdata.kv().get(OPENSTACK_RELEASE_KEY, None)
(Pdb) c
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(528)os_release()
-> if reset_cache:
(Pdb) l
523 be returned.
524 '''
525 import pdb
526 pdb.set_trace()
527 global _os_rel
528 -> if reset_cache:
529 reset_os_release()
530 if _os_rel:
531 return _os_rel
532 _os_rel = (
533 git_os_codename_install_source(config('openstack-origin-git')) or
(Pdb) args
package = 'python-keystonemiddleware'
base = 'essex'
reset_cache = False
(Pdb) w
/var/lib/juju/agents/unit-keystone-ldap-0/charm/hooks/install(19)<module>()
-> main()
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms/reactive/__init__.py(113)main()
-> bus.dispatch(restricted=restricted_mode)
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py(364)dispatch()
-> _invoke(other_handlers)
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py(340)_invoke()
-> handler.invoke()
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py(162)invoke()
-> self._action(*args)
/var/lib/juju/agents/unit-keystone-ldap-0/charm/reactive/keystone_ldap_handlers.py(63)assess_status()
-> with charm.provide_charm_instance() as kldap_charm:
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms_openstack/charm/core.py(87)__enter__()
-> return BaseOpenStackCharm.singleton
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms_openstack/charm/core.py(295)singleton()
-> release = _release_selector_function()
/var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charms_openstack/charm/defaults.py(99)default_select_release()
-> release_version = unitdata.kv().get(OPENSTACK_RELEASE_KEY, None)
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(528)os_release()
-> if reset_cache:
(Pdb) args
package = 'python-keystonemiddleware'
base = 'essex'
reset_cache = False
(Pdb) l
534 get_os_codename_package(package, fatal=False) or
535 get_os_codename_install_source(config('openstack-origin')) or
536 base)
537 return _os_rel
538
539
540 @deprecate("moved to charmhelpers.fetch.import_key()", "2017-07", log=juju_log)
541 def import_key(keyid):
542 """Import a key, either ASCII armored, or a GPG key id.
543
544 @param keyid: the key in ASCII armor format, or a GPG key id.
(Pdb) l .
523 be returned.
524 '''
525 import pdb
526 pdb.set_trace()
527 global _os_rel
528 -> if reset_cache:
529 reset_os_release()
530 if _os_rel:
531 return _os_rel
532 _os_rel = (
533 git_os_codename_install_source(config('openstack-origin-git')) or
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(530)os_release()
-> if _os_rel:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(533)os_release()
-> git_os_codename_install_source(config('openstack-origin-git')) or
(Pdb) l
528 if reset_cache:
529 reset_os_release()
530 if _os_rel:
531 return _os_rel
532 _os_rel = (
533 -> git_os_codename_install_source(config('openstack-origin-git')) or
534 get_os_codename_package(package, fatal=False) or
535 get_os_codename_install_source(config('openstack-origin')) or
536 base)
537 return _os_rel
538
(Pdb) l
539
540 @deprecate("moved to charmhelpers.fetch.import_key()", "2017-07", log=juju_log)
541 def import_key(keyid):
542 """Import a key, either ASCII armored, or a GPG key id.
543
544 @param keyid: the key in ASCII armor format, or a GPG key id.
545 @raises SystemExit() via sys.exit() on failure.
546 """
547 try:
548 return fetch_import_key(keyid)
549 except GPGKeyError as e:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(534)os_release()
-> get_os_codename_package(package, fatal=False) or
(Pdb) package
'python-keystonemiddleware'
(Pdb) s
--Call--
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(412)get_os_codename_package()
-> def get_os_codename_package(package, fatal=True):
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(415)get_os_codename_package()
-> if snap_install_requested():
(Pdb) l
410
411
412 def get_os_codename_package(package, fatal=True):
413 '''Derive OpenStack release codename from an installed package.'''
414
415 -> if snap_install_requested():
416 cmd = ['snap', 'list', package]
417 try:
418 out = subprocess.check_output(cmd)
419 if six.PY3:
420 out = out.decode('UTF-8')
(Pdb) args
package = 'python-keystonemiddleware'
fatal = False
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(429)get_os_codename_package()
-> import apt_pkg as apt
(Pdb) l
424 for line in lines:
425 if package in line:
426 # Second item in list is Version
427 return line.split()[1]
428
429 -> import apt_pkg as apt
430
431 cache = apt_cache()
432
433 try:
434 pkg = cache[package]
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(431)get_os_codename_package()
-> cache = apt_cache()
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(433)get_os_codename_package()
-> try:
(Pdb) cache
<apt_pkg.Cache object at 0x7f6ad1a39d48>
(Pdb) l
428
429 import apt_pkg as apt
430
431 cache = apt_cache()
432
433 -> try:
434 pkg = cache[package]
435 except Exception:
436 if not fatal:
437 return None
438 # the package is unknown to the current apt cache.
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(434)get_os_codename_package()
-> pkg = cache[package]
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(443)get_os_codename_package()
-> if not pkg.current_ver:
(Pdb) pkg
<apt_pkg.Package object: name:'python-keystonemiddleware' id:10075>
(Pdb) l
438 # the package is unknown to the current apt cache.
439 e = 'Could not determine version of package with no installation '\
440 'candidate: %s' % package
441 error_out(e)
442
443 -> if not pkg.current_ver:
444 if not fatal:
445 return None
446 # package is known, but no version is currently installed.
447 e = 'Could not determine version of uninstalled package: %s' % package
448 error_out(e)
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(450)get_os_codename_package()
-> vers = apt.upstream_version(pkg.current_ver.ver_str)
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(451)get_os_codename_package()
-> if 'swift' in pkg.name:
(Pdb) vers
'4.14.0'
(Pdb) l
446 # package is known, but no version is currently installed.
447 e = 'Could not determine version of uninstalled package: %s' % package
448 error_out(e)
449
450 vers = apt.upstream_version(pkg.current_ver.ver_str)
451 -> if 'swift' in pkg.name:
452 # Fully x.y.z match for swift versions
453 match = re.match('^(\d+)\.(\d+)\.(\d+)', vers)
454 else:
455 # x.y match only for 20XX.X
456 # and ignore patch level for other packages
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(457)get_os_codename_package()
-> match = re.match('^(\d+)\.(\d+)', vers)
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(459)get_os_codename_package()
-> if match:
(Pdb) l
454 else:
455 # x.y match only for 20XX.X
456 # and ignore patch level for other packages
457 match = re.match('^(\d+)\.(\d+)', vers)
458
459 -> if match:
460 vers = match.group(0)
461
462 # Generate a major version number for newer semantic
463 # versions of openstack projects
464 major_vers = vers.split('.')[0]
(Pdb) match
<_sre.SRE_Match object; span=(0, 4), match='4.14'>
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(460)get_os_codename_package()
-> vers = match.group(0)
(Pdb) vers
'4.14.0'
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(464)get_os_codename_package()
-> major_vers = vers.split('.')[0]
(Pdb) vers
'4.14'
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(466)get_os_codename_package()
-> if (package in PACKAGE_CODENAMES and
(Pdb) major_vers
'4'
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(471)get_os_codename_package()
-> try:
(Pdb) l
466 if (package in PACKAGE_CODENAMES and
467 major_vers in PACKAGE_CODENAMES[package]):
468 return PACKAGE_CODENAMES[package][major_vers]
469 else:
470 # < Liberty co-ordinated project versions
471 -> try:
472 if 'swift' in pkg.name:
473 return get_swift_codename(vers)
474 else:
475 return OPENSTACK_CODENAMES[vers]
476 except KeyError:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(472)get_os_codename_package()
-> if 'swift' in pkg.name:
(Pdb) l
467 major_vers in PACKAGE_CODENAMES[package]):
468 return PACKAGE_CODENAMES[package][major_vers]
469 else:
470 # < Liberty co-ordinated project versions
471 try:
472 -> if 'swift' in pkg.name:
473 return get_swift_codename(vers)
474 else:
475 return OPENSTACK_CODENAMES[vers]
476 except KeyError:
477 if not fatal:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(475)get_os_codename_package()
-> return OPENSTACK_CODENAMES[vers]
(Pdb) l
470 # < Liberty co-ordinated project versions
471 try:
472 if 'swift' in pkg.name:
473 return get_swift_codename(vers)
474 else:
475 -> return OPENSTACK_CODENAMES[vers]
476 except KeyError:
477 if not fatal:
478 return None
479 e = 'Could not determine OpenStack codename for version %s' % vers
480 error_out(e)
(Pdb) OPENSTACK_CODENAMES
OrderedDict([('2011.2', 'diablo'), ('2012.1', 'essex'), ('2012.2', 'folsom'), ('2013.1', 'grizzly'), ('2013.2', 'havana'), ('2014.1', 'icehouse'), ('2014.2', 'juno'), ('2015.1', 'kilo'), ('2015.2', 'liberty'), ('2016.1', 'mitaka'), ('2016.2', 'newton'), ('2017.1', 'ocata'), ('2017.2', 'pike'), ('2018.1', 'queens')])
(Pdb) vers
'4.14'
(Pdb) OPENSTACK_CODENAMES[vers]
*** KeyError: '4.14'
(Pdb) n
KeyError: '4.14'
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(475)get_os_codename_package()
-> return OPENSTACK_CODENAMES[vers]
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(476)get_os_codename_package()
-> except KeyError:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(477)get_os_codename_package()
-> if not fatal:
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(478)get_os_codename_package()
-> return None
(Pdb) n
--Return--
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(478)get_os_codename_package()->None
-> return None
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(535)os_release()
-> get_os_codename_install_source(config('openstack-origin')) or
(Pdb) l
530 if _os_rel:
531 return _os_rel
532 _os_rel = (
533 git_os_codename_install_source(config('openstack-origin-git')) or
534 get_os_codename_package(package, fatal=False) or
535 -> get_os_codename_install_source(config('openstack-origin')) or
536 base)
537 return _os_rel
538
539
540 @deprecate("moved to charmhelpers.fetch.import_key()", "2017-07", log=juju_log)
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(536)os_release()
-> base)
(Pdb) n
> /var/lib/juju/agents/unit-keystone-ldap-0/.venv/lib/python3.5/site-packages/charmhelpers/contrib/openstack/utils.py(537)os_release()
-> return _os_rel
(Pdb) _os_rel
'essex'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.