Add --version argument
Change-Id: I6d67e0b5b9d7dbae400ec94bdf41e2e1b47fa509
This commit is contained in:
parent
4fc170630c
commit
a4f6404287
@ -27,6 +27,7 @@ from os_apply_config import collect_config
|
|||||||
from os_apply_config import config_exception as exc
|
from os_apply_config import config_exception as exc
|
||||||
from os_apply_config import renderers
|
from os_apply_config import renderers
|
||||||
from os_apply_config import value_types
|
from os_apply_config import value_types
|
||||||
|
from os_apply_config import version
|
||||||
|
|
||||||
TEMPLATES_DIR = os.environ.get('OS_CONFIG_APPLIER_TEMPLATES', None)
|
TEMPLATES_DIR = os.environ.get('OS_CONFIG_APPLIER_TEMPLATES', None)
|
||||||
if TEMPLATES_DIR is None:
|
if TEMPLATES_DIR is None:
|
||||||
@ -197,6 +198,8 @@ def parse_opts(argv):
|
|||||||
' not subject to type restrictions. If --key is'
|
' not subject to type restrictions. If --key is'
|
||||||
' specified and no default is specified, program'
|
' specified and no default is specified, program'
|
||||||
' exits with an error on missing key.')
|
' exits with an error on missing key.')
|
||||||
|
parser.add_argument('--version', action='version',
|
||||||
|
version=version.version_info.version_string())
|
||||||
opts = parser.parse_args(argv[1:])
|
opts = parser.parse_args(argv[1:])
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
18
os_apply_config/version.py
Normal file
18
os_apply_config/version.py
Normal 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-apply-config')
|
Loading…
Reference in New Issue
Block a user