Pass in the right env var too
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
995592a555
commit
767316125d
@ -75,7 +75,7 @@ task or expose it in the environment and it will be picked up.
|
|||||||
Include an entry in your `requirements.yml` like so.
|
Include an entry in your `requirements.yml` like so.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- src: https://git.autonomic.zone/autonomic-cooperative/autonomic.gandi/archive/0.0.4.tar.gz
|
- src: https://git.autonomic.zone/autonomic-cooperative/autonomic.gandi/archive/0.0.5.tar.gz
|
||||||
name: autonomic.gandi
|
name: autonomic.gandi
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -70,18 +70,19 @@ def error_msg(domain):
|
|||||||
).format(domain=domain)
|
).format(domain=domain)
|
||||||
|
|
||||||
|
|
||||||
def get_env():
|
def get_env(module):
|
||||||
"""Build environment for running command-line commands."""
|
"""Build environment for running command-line commands."""
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["PROVIDER"] = "gandi"
|
env["PROVIDER"] = "gandi"
|
||||||
env["LEXICON_GANDI_API_PROTOCOL"] = "rest"
|
env["LEXICON_GANDI_API_PROTOCOL"] = "rest"
|
||||||
|
env["LEXICON_GANDI_AUTH_TOKEN"] = module.params["gandi_rest_token"]
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
|
||||||
def retrieve_domain_info(module):
|
def retrieve_domain_info(module):
|
||||||
"""Retrieve all information about a specific domain."""
|
"""Retrieve all information about a specific domain."""
|
||||||
domain = module.params["domain"]
|
domain = module.params["domain"]
|
||||||
env = get_env()
|
env = get_env(module)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return json.loads(
|
return json.loads(
|
||||||
@ -98,7 +99,7 @@ def create_domain(module):
|
|||||||
"""Create a new DNS entry."""
|
"""Create a new DNS entry."""
|
||||||
domain = module.params["domain"]
|
domain = module.params["domain"]
|
||||||
ipv4 = module.params["ipv4"]
|
ipv4 = module.params["ipv4"]
|
||||||
env = get_env()
|
env = get_env(module)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return json.loads(
|
return json.loads(
|
||||||
@ -127,7 +128,7 @@ def delete_domain(module):
|
|||||||
"""Delete an existing DNS entry."""
|
"""Delete an existing DNS entry."""
|
||||||
domain = module.params["domain"]
|
domain = module.params["domain"]
|
||||||
ipv4 = module.params["ipv4"]
|
ipv4 = module.params["ipv4"]
|
||||||
env = get_env()
|
env = get_env(module)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return json.loads(
|
return json.loads(
|
||||||
|
Loading…
Reference in New Issue
Block a user