Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
a35fcf44
Commit
a35fcf44
authored
Feb 14, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ansible: restructure to avoid intermediate imports
parent
3fc67356
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
16 deletions
+15
-16
ansible_mitogen/__init__.py
ansible_mitogen/__init__.py
+0
-0
ansible_mitogen/action/__init__.py
ansible_mitogen/action/__init__.py
+0
-0
ansible_mitogen/action/mitogen.py
ansible_mitogen/action/mitogen.py
+2
-2
ansible_mitogen/connection/__init__.py
ansible_mitogen/connection/__init__.py
+0
-0
ansible_mitogen/connection/mitogen.py
ansible_mitogen/connection/mitogen.py
+8
-8
ansible_mitogen/helpers.py
ansible_mitogen/helpers.py
+0
-2
ansible_mitogen/strategy/__init__.py
ansible_mitogen/strategy/__init__.py
+0
-0
ansible_mitogen/strategy/mitogen.py
ansible_mitogen/strategy/mitogen.py
+4
-2
mitogen/core.py
mitogen/core.py
+0
-1
setup.py
setup.py
+1
-1
No files found.
mitogen/ansible
/__init__.py
→
ansible_mitogen
/__init__.py
View file @
a35fcf44
File moved
ansible_mitogen/action/__init__.py
0 → 100644
View file @
a35fcf44
mitogen/ansible/actio
n.py
→
ansible_mitogen/action/mitoge
n.py
View file @
a35fcf44
...
...
@@ -31,7 +31,7 @@ import os
import
ansible
import
ansible.plugins
import
ansible.plugins.action.normal
import
mitogen.ansible
.helpers
import
ansible_mitogen
.helpers
ANSIBLE_BASEDIR
=
os
.
path
.
dirname
(
ansible
.
__file__
)
...
...
@@ -57,7 +57,7 @@ class ActionModule(ansible.plugins.action.normal.ActionModule):
#####################################################################
py_module_name
=
self
.
get_py_module_name
(
module_name
)
js
=
self
.
_connection
.
py_call
(
mitogen
.
ansible
.
helpers
.
run_module
,
py_module_name
,
js
=
self
.
_connection
.
py_call
(
ansible_mitogen
.
helpers
.
run_module
,
py_module_name
,
args
=
json
.
loads
(
json
.
dumps
(
module_args
)))
#####################################################################
...
...
ansible_mitogen/connection/__init__.py
0 → 100644
View file @
a35fcf44
mitogen/ansible/connectio
n.py
→
ansible_mitogen/connection/mitoge
n.py
View file @
a35fcf44
...
...
@@ -42,12 +42,12 @@ Enable it by:
EOF
"""
import
mitogen.master
import
mitogen.unix
from
mitogen.ansible
import
helpers
from
__future__
import
absolute_import
import
ansible.errors
import
ansible.plugins.connection
import
ansible_mitogen.helpers
import
mitogen.unix
class
Connection
(
ansible
.
plugins
.
connection
.
ConnectionBase
):
...
...
@@ -78,15 +78,15 @@ class Connection(ansible.plugins.connection.ConnectionBase):
super
(
Connection
,
self
).
exec_command
(
cmd
,
in_data
=
in_data
,
sudoable
=
sudoable
)
if
in_data
:
raise
ansible
.
errors
.
AnsibleError
(
"does not support module pipelining"
)
return
self
.
py_call
(
helpers
.
exec_command
,
cmd
,
in_data
)
return
self
.
py_call
(
ansible_mitogen
.
helpers
.
exec_command
,
cmd
,
in_data
)
def
fetch_file
(
self
,
in_path
,
out_path
):
output
=
self
.
py_call
(
helpers
.
read_path
,
in_path
)
helpers
.
write_path
(
out_path
,
output
)
output
=
self
.
py_call
(
ansible_mitogen
.
helpers
.
read_path
,
in_path
)
ansible_mitogen
.
helpers
.
write_path
(
out_path
,
output
)
def
put_file
(
self
,
in_path
,
out_path
):
self
.
py_call
(
helpers
.
write_path
,
out_path
,
helpers
.
read_path
(
in_path
))
self
.
py_call
(
ansible_mitogen
.
helpers
.
write_path
,
out_path
,
ansible_mitogen
.
helpers
.
read_path
(
in_path
))
def
close
(
self
):
self
.
router
.
broker
.
shutdown
()
...
...
mitogen/ansible
/helpers.py
→
ansible_mitogen
/helpers.py
View file @
a35fcf44
...
...
@@ -38,8 +38,6 @@ import json
import
subprocess
import
time
import
mitogen
# Prevent accidental import of an Ansible module from hanging on stdin read.
import
ansible.module_utils.basic
ansible
.
module_utils
.
basic
.
_ANSIBLE_ARGS
=
'{}'
...
...
ansible_mitogen/strategy/__init__.py
0 → 100644
View file @
a35fcf44
mitogen/ansible/strategy
.py
→
ansible_mitogen/strategy/mitogen
.py
View file @
a35fcf44
...
...
@@ -25,12 +25,14 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from
__future__
import
absolute_import
import
mitogen
import
mitogen.master
import
mitogen.service
import
mitogen.unix
import
mitogen.utils
import
mitogen.ansible.actio
n
import
ansible_mitogen.action.mitoge
n
import
ansible.errors
import
ansible.plugins.strategy.linear
...
...
@@ -71,7 +73,7 @@ class StrategyModule(ansible.plugins.strategy.linear.StrategyModule):
real_get
=
action_loader
.
get
def
get
(
name
,
*
args
,
**
kwargs
):
if
name
==
'normal'
:
return
mitogen
.
ansible
.
actio
n
.
ActionModule
(
*
args
,
**
kwargs
)
return
ansible_mitogen
.
action
.
mitoge
n
.
ActionModule
(
*
args
,
**
kwargs
)
return
real_get
(
name
,
*
args
,
**
kwargs
)
action_loader
.
get
=
get
...
...
mitogen/core.py
View file @
a35fcf44
...
...
@@ -407,7 +407,6 @@ class Importer(object):
def
__init__
(
self
,
router
,
context
,
core_src
):
self
.
_context
=
context
self
.
_present
=
{
'mitogen'
:
[
'mitogen.ansible'
,
'mitogen.compat'
,
'mitogen.compat.pkgutil'
,
'mitogen.fakessh'
,
...
...
setup.py
View file @
a35fcf44
...
...
@@ -35,7 +35,7 @@ setup(
author
=
'David Wilson'
,
license
=
'New BSD'
,
url
=
'https://github.com/dw/mitogen/'
,
packages
=
[
'mitogen'
],
packages
=
[
'mitogen'
,
'ansible_mitogen'
],
zip_safe
=
False
,
classifiers
=
[
'Development Status :: 3 - Alpha'
,
...
...
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