Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set env variable for api version in python context #66

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions esiclient/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
#

import logging
import os

from osc_lib import utils

LOG = logging.getLogger(__name__)

DEFAULT_BAREMETAL_API_VERSION = '1.69'
DEFAULT_ESICLIENT_API_VERSION = '1'

# Required by the OSC plugin interface
Expand All @@ -42,6 +44,8 @@ def build_option_parser(parser):
:param argparse.ArgumentParser parser: The parser object that has been
initialized by OpenStackShell.
"""
if ('OS_BAREMETAL_API_VERSION' not in os.environ):
os.environ['OS_BAREMETAL_API_VERSION'] = DEFAULT_BAREMETAL_API_VERSION
parser.add_argument(
'--os-esiclient-api-version',
metavar='<esiclient-api-version>',
Expand Down
Loading