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
a8d74822
Commit
a8d74822
authored
12 years ago
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't prompt for password info if the pattern wouldn't have matched any hosts. Also convert
Runner() usage to the new inventory model.
parent
3081bb93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
bin/ansible
+9
-2
No files found.
bin/ansible
View file @
a8d74822
...
@@ -29,6 +29,7 @@ import ansible.constants as C
...
@@ -29,6 +29,7 @@ import ansible.constants as C
from
ansible
import
utils
from
ansible
import
utils
from
ansible
import
errors
from
ansible
import
errors
from
ansible
import
callbacks
from
ansible
import
callbacks
from
ansible
import
inventory
########################################################
########################################################
...
@@ -69,6 +70,13 @@ class Cli(object):
...
@@ -69,6 +70,13 @@ class Cli(object):
''' use Runner lib to do SSH things '''
''' use Runner lib to do SSH things '''
pattern
=
args
[
0
]
pattern
=
args
[
0
]
inventory_manager
=
inventory
.
Inventory
(
options
.
inventory
)
hosts
=
inventory_manager
.
list_hosts
(
pattern
)
if
len
(
hosts
)
==
0
:
print
>>
sys
.
stderr
,
"No hosts matched"
sys
.
exit
(
1
)
sshpass
=
None
sshpass
=
None
sudopass
=
None
sudopass
=
None
if
options
.
ask_pass
:
if
options
.
ask_pass
:
...
@@ -78,7 +86,6 @@ class Cli(object):
...
@@ -78,7 +86,6 @@ class Cli(object):
if
options
.
tree
:
if
options
.
tree
:
utils
.
prepare_writeable_dir
(
options
.
tree
)
utils
.
prepare_writeable_dir
(
options
.
tree
)
if
options
.
seconds
:
if
options
.
seconds
:
print
"background launch...
\n\n
"
print
"background launch...
\n\n
"
...
@@ -86,7 +93,7 @@ class Cli(object):
...
@@ -86,7 +93,7 @@ class Cli(object):
module_name
=
options
.
module_name
,
module_path
=
options
.
module_path
,
module_name
=
options
.
module_name
,
module_path
=
options
.
module_path
,
module_args
=
options
.
module_args
,
module_args
=
options
.
module_args
,
remote_user
=
options
.
remote_user
,
remote_pass
=
sshpass
,
remote_user
=
options
.
remote_user
,
remote_pass
=
sshpass
,
host_list
=
options
.
inventory
,
timeout
=
options
.
timeout
,
inventory
=
inventory_manager
,
timeout
=
options
.
timeout
,
forks
=
options
.
forks
,
forks
=
options
.
forks
,
background
=
options
.
seconds
,
pattern
=
pattern
,
background
=
options
.
seconds
,
pattern
=
pattern
,
callbacks
=
self
.
callbacks
,
sudo
=
options
.
sudo
,
callbacks
=
self
.
callbacks
,
sudo
=
options
.
sudo
,
...
...
This diff is collapsed.
Click to expand it.
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