Skip to content

Commit

Permalink
Merge pull request #66 from sheldor1510/api-version-error
Browse files Browse the repository at this point in the history
set env variable for api version in python context
  • Loading branch information
tzumainn authored Jul 19, 2024
2 parents 71119c5 + 148775b commit 3ab0c27
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 3ab0c27

Please sign in to comment.