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
babf47de
Commit
babf47de
authored
Sep 28, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up some bugs related to --limit on adhoc commands
parent
62157568
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/ansible/cli/adhoc.py
+6
-5
No files found.
lib/ansible/cli/adhoc.py
View file @
babf47de
...
...
@@ -18,7 +18,7 @@
########################################################
from
ansible
import
constants
as
C
from
ansible.cli
import
CLI
from
ansible.errors
import
AnsibleOptionsError
from
ansible.errors
import
Ansible
Error
,
Ansible
OptionsError
from
ansible.executor.task_queue_manager
import
TaskQueueManager
from
ansible.inventory
import
Inventory
from
ansible.parsing
import
DataLoader
...
...
@@ -117,10 +117,11 @@ class AdHocCLI(CLI):
self
.
display
.
warning
(
"provided hosts list is empty, only localhost is available"
)
no_hosts
=
True
inventory
.
subset
(
self
.
options
.
subset
)
if
len
(
inventory
.
list_hosts
())
==
0
and
not
no_hosts
:
# Invalid limit
raise
AnsibleError
(
"Specified --limit does not match any hosts"
)
if
self
.
options
.
subset
:
inventory
.
subset
(
self
.
options
.
subset
)
if
len
(
inventory
.
list_hosts
())
==
0
and
not
no_hosts
:
# Invalid limit
raise
AnsibleError
(
"Specified --limit does not match any hosts"
)
if
self
.
options
.
listhosts
:
self
.
display
.
display
(
' hosts (
%
d):'
%
len
(
hosts
))
...
...
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