~james-page/charm-helpers/misc-https-fixes

« back to all changes in this revision

Viewing changes to charmhelpers/core/host.py

  • Committer: Denis Buliga
  • Date: 2016-08-11 15:47:44 UTC
  • mto: This revision was merged to the branch mainline in revision 620.
  • Revision ID: dbuliga@cloudbasesolutions.com-20160811154744-pubbvmkbtl91nr3j
Implemented changes. Addressed review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import hashlib
31
31
import functools
32
32
import itertools
 
33
import six
 
34
 
33
35
from contextlib import contextmanager
34
36
from collections import OrderedDict
35
 
 
36
 
import six
37
 
 
38
37
from .hookenv import log
39
38
from .fstab import Fstab
40
39
from charmhelpers.osplatform import get_platform
42
41
__platform__ = get_platform()
43
42
if __platform__ == "ubuntu":
44
43
    from charmhelpers.core.host_factory.ubuntu import (
45
 
        service_available_host,
46
 
        add_group_host,
47
 
        lsb_release_host,
48
 
        cmp_pkgrevno_host,
49
 
    )
 
44
        service_available,
 
45
        add_new_group,
 
46
        lsb_release,
 
47
        cmp_pkgrevno,
 
48
    )  # flake8: noqa -- ignore F401 for this import
50
49
elif __platform__ == "centos":
51
50
    from charmhelpers.core.host_factory.centos import (
52
 
        service_available_host,
53
 
        add_group_host,
54
 
        lsb_release_host,
55
 
        cmp_pkgrevno_host,
56
 
    )
57
 
 
58
 
service_available = service_available_host
59
 
lsb_release = lsb_release_host
60
 
cmp_pkgrevno = cmp_pkgrevno_host
 
51
        service_available,
 
52
        add_new_group,
 
53
        lsb_release,
 
54
        cmp_pkgrevno,
 
55
    )  # flake8: noqa -- ignore F401 for this import
61
56
 
62
57
 
63
58
def service_start(service_name):
299
294
            log('group with gid {0} already exists!'.format(gid))
300
295
    except KeyError:
301
296
        log('creating group {0}'.format(group_name))
302
 
        add_group_host(group_name, system_group, gid)
 
297
        add_new_group(group_name, system_group, gid)
303
298
        group_info = grp.getgrnam(group_name)
304
299
    return group_info
305
300