Skip to content

Commit

Permalink
Update inventory.py to use vars in inventory
Browse files Browse the repository at this point in the history
Currently it is using os environment variables, this change allows the use of variables in the inventory itself
  • Loading branch information
ydewinte authored Sep 15, 2023
1 parent cb6f76e commit c38e1d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/inventory/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def parse(self, inventory, loader, path, cache=False):

# Try getting variables from env
try:
host = os.getenv("MAAS_HOST")
token_key = os.getenv("MAAS_TOKEN_KEY")
token_secret = os.getenv("MAAS_TOKEN_SECRET")
customer_key = os.getenv("MAAS_CUSTOMER_KEY")
host = self.get_option("maas_host")
token_key = self.get_option("maas_token_key")
token_secret = self.get_option("maas_token_secret")
customer_key = self.get_option("maas_customer_key")
except KeyError:
raise errors.MaasError(
"Missing parameters: MAAS_HOST, MAAS_TOKEN_KEY, MAAS_TOKEN_SECRET, MAAS_CUSTOMER_KEY."
Expand Down

0 comments on commit c38e1d1

Please sign in to comment.