diff --git a/os_collect_config/collect.py b/os_collect_config/collect.py index 2c9460d..77cbfdb 100644 --- a/os_collect_config/collect.py +++ b/os_collect_config/collect.py @@ -28,6 +28,7 @@ from os_collect_config import common from os_collect_config import ec2 from os_collect_config import exc from os_collect_config import heat_local +from os_collect_config import version from oslo.config import cfg DEFAULT_COLLECTORS = ['heat_local', 'ec2', 'cfn'] @@ -167,7 +168,8 @@ def getfilehash(files): def __main__(args=sys.argv, requests_impl_map=None): signal.signal(signal.SIGHUP, reexec_self) setup_conf() - CONF(args=args[1:], prog="os-collect-config") + CONF(args=args[1:], prog="os-collect-config", + version=version.version_info.version_string()) # This resets the logging infrastructure which prevents capturing log # output in tests cleanly, so should only be called if there isn't already diff --git a/os_collect_config/version.py b/os_collect_config/version.py new file mode 100644 index 0000000..d8aec69 --- /dev/null +++ b/os_collect_config/version.py @@ -0,0 +1,18 @@ +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +import pbr.version + +version_info = pbr.version.VersionInfo('os-collect-config')