Merge "Make --version work properly"

This commit is contained in:
Jenkins 2013-09-18 18:15:51 +00:00 committed by Gerrit Code Review
commit f1f71c05e7
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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')