Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
55ed4489
Commit
55ed4489
authored
Aug 31, 2014
by
Matt Martz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform region validation early to be more explicit about invalid region failures
parent
69e79995
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
lib/ansible/module_utils/rax.py
+4
-3
library/cloud/rax_dns
+1
-1
library/cloud/rax_dns_record
+1
-1
No files found.
lib/ansible/module_utils/rax.py
View file @
55ed4489
...
...
@@ -212,7 +212,7 @@ def rax_required_together():
return
[[
'api_key'
,
'username'
]]
def
setup_rax_module
(
module
,
rax_module
):
def
setup_rax_module
(
module
,
rax_module
,
region_required
=
True
):
rax_module
.
USER_AGENT
=
'ansible/
%
s
%
s'
%
(
ANSIBLE_VERSION
,
rax_module
.
USER_AGENT
)
...
...
@@ -270,7 +270,8 @@ def setup_rax_module(module, rax_module):
except
Exception
,
e
:
module
.
fail_json
(
msg
=
'
%
s'
%
e
.
message
)
rax_module
.
USER_AGENT
=
'ansible/
%
s
%
s'
%
(
ANSIBLE_VERSION
,
rax_module
.
USER_AGENT
)
if
region_required
and
region
not
in
rax_module
.
regions
:
module
.
fail_json
(
msg
=
'
%
s is not a valid region, must be one of:
%
s'
%
(
region
,
','
.
join
(
rax_module
.
regions
)))
return
rax_module
library/cloud/rax_dns
View file @
55ed4489
...
...
@@ -160,7 +160,7 @@ def main():
state
=
module
.
params
.
get
(
'state'
)
ttl
=
module
.
params
.
get
(
'ttl'
)
setup_rax_module
(
module
,
pyrax
)
setup_rax_module
(
module
,
pyrax
,
False
)
rax_dns
(
module
,
comment
,
email
,
name
,
state
,
ttl
)
...
...
library/cloud/rax_dns_record
View file @
55ed4489
...
...
@@ -312,7 +312,7 @@ def main():
ttl
=
module
.
params
.
get
(
'ttl'
)
record_type
=
module
.
params
.
get
(
'type'
)
setup_rax_module
(
module
,
pyrax
)
setup_rax_module
(
module
,
pyrax
,
False
)
if
record_type
.
upper
()
==
'PTR'
:
if
not
server
and
not
loadbalancer
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment