~ubuntu-branches/ubuntu/trusty/ceilometer/trusty-proposed

« back to all changes in this revision

Viewing changes to ceilometer/openstack/common/config/generator.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Chuck Short
  • Date: 2014-01-23 15:08:11 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140123150811-1zaismsuyh1hcl8y
Tags: 2014.1~b2-0ubuntu1
[ James Page ]
* d/control: Add python-jsonpath-rw to BD's.
* d/p/fix-setup-requirements.patch: Bump WebOb to support < 1.4.
 (LP: #1261101)

[ Chuck Short ]
* New upstream version.
* debian/control, debian/ceilometer-common.install: Split out
  ceilometer-alarm-evaluator and ceilometer-alarm-notifier into their
  own packages. (LP: #1250002)
* debian/ceilometer-agent-central.logrotate,
  debian/ceilometer-agent-compute.logrotate,
  debian/ceilometer-api.logrotate,
  debian/ceilometer-collector.logrotate: Add logrotate files, 
  thanks to Ahmed Rahal. (LP: #1224223)
* Fix typos in upstart files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
                            os.path.basename(filepath).split('.')[0]])
68
68
        mods_by_pkg.setdefault(pkg_name, list()).append(mod_str)
69
69
    # NOTE(lzyeval): place top level modules before packages
70
 
    pkg_names = filter(lambda x: x.endswith(PY_EXT), mods_by_pkg.keys())
71
 
    pkg_names.sort()
72
 
    ext_names = filter(lambda x: x not in pkg_names, mods_by_pkg.keys())
73
 
    ext_names.sort()
 
70
    pkg_names = sorted(pkg for pkg in mods_by_pkg if pkg.endswith(PY_EXT))
 
71
    ext_names = sorted(pkg for pkg in mods_by_pkg if pkg not in pkg_names)
74
72
    pkg_names.extend(ext_names)
75
73
 
76
74
    # opts_by_group is a mapping of group name to an options list
102
100
                opts_by_group.setdefault(group, []).append((mod_str, opts))
103
101
 
104
102
    print_group_opts('DEFAULT', opts_by_group.pop('DEFAULT', []))
105
 
    for group, opts in opts_by_group.items():
106
 
        print_group_opts(group, opts)
 
103
    for group in sorted(opts_by_group.keys()):
 
104
        print_group_opts(group, opts_by_group[group])
107
105
 
108
106
 
109
107
def _import_module(mod_str):
120
118
 
121
119
def _is_in_group(opt, group):
122
120
    "Check if opt is in group."
123
 
    for key, value in group._opts.items():
124
 
        if value['opt'] == opt:
 
121
    for value in group._opts.values():
 
122
        # NOTE(llu): Temporary workaround for bug #1262148, wait until
 
123
        # newly released oslo.config support '==' operator.
 
124
        if not(value['opt'] != opt):
125
125
            return True
126
126
    return False
127
127
 
132
132
        return 'DEFAULT'
133
133
 
134
134
    # what other groups is it in?
135
 
    for key, value in cfg.CONF.items():
 
135
    for value in cfg.CONF.values():
136
136
        if isinstance(value, cfg.CONF.GroupAttr):
137
137
            if _is_in_group(opt, value._group):
138
138
                return value._group.name