~peter-sabaini/charm-helpers/bcache-helpers

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/openstack/context.py

  • Committer: David Ames
  • Date: 2017-03-27 16:46:43 UTC
  • mfrom: (719.1.5 charm-helpers)
  • Revision ID: david.ames@canonical.com-20170327164643-ngmy4f1qqiyrxip8
[ajkavanagh, r=thedac] Re-organize alphanumeric comparisons

Allow the use of alphanumeric comparisons *in* charmhelpers
Move BasicStringComparator to charmhelpers.core.strutils
Rename CompareUbuntuReleases to CompareHostReleases

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    write_file,
60
60
    pwgen,
61
61
    lsb_release,
 
62
    CompareHostReleases,
62
63
)
63
64
from charmhelpers.contrib.hahelpers.cluster import (
64
65
    determine_apache_port,
94
95
    git_determine_usr_bin,
95
96
    git_determine_python_path,
96
97
    enable_memcache,
97
 
    CompareUbuntuReleases,
98
98
)
99
99
from charmhelpers.core.unitdata import kv
100
100
 
1606
1606
            # Trusty version of memcached does not support ::1 as a listen
1607
1607
            # address so use host file entry instead
1608
1608
            release = lsb_release()['DISTRIB_CODENAME'].lower()
1609
 
            if CompareUbuntuReleases(release) > 'trusty':
 
1609
            if CompareHostReleases(release) > 'trusty':
1610
1610
                ctxt['memcache_server'] = '::1'
1611
1611
            else:
1612
1612
                ctxt['memcache_server'] = 'ip6-localhost'