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
49c3ee90
Commit
49c3ee90
authored
Apr 26, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #247 from cocoy/devel
Do not override the value of user and hostname.
parents
7773a622
1220a46e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/ansible/connection.py
+6
-5
No files found.
lib/ansible/connection.py
View file @
49c3ee90
...
@@ -81,7 +81,8 @@ class ParamikoConnection(object):
...
@@ -81,7 +81,8 @@ class ParamikoConnection(object):
keypair
=
None
keypair
=
None
# Read file ~/.ssh/config, get data hostname, keyfile, port, etc
# Read file ~/.ssh/config, get data hostname, keyfile, port, etc
# This overrides the ansible defined username,hostname and port
# This will *NOT* overrides the ansible username and hostname " , getting the port and keyfile only.
try
:
try
:
ssh_config
=
paramiko
.
SSHConfig
()
ssh_config
=
paramiko
.
SSHConfig
()
config_file
=
(
'~/.ssh/config'
)
config_file
=
(
'~/.ssh/config'
)
...
@@ -92,12 +93,12 @@ class ParamikoConnection(object):
...
@@ -92,12 +93,12 @@ class ParamikoConnection(object):
except
IOError
,
e
:
except
IOError
,
e
:
raise
errors
.
AnsibleConnectionFailed
(
str
(
e
))
raise
errors
.
AnsibleConnectionFailed
(
str
(
e
))
if
'hostname'
in
credentials
:
#
if 'hostname' in credentials:
self
.
host
=
credentials
[
'hostname'
]
#
self.host = credentials['hostname']
if
'port'
in
credentials
:
if
'port'
in
credentials
:
self
.
port
=
int
(
credentials
[
'port'
])
self
.
port
=
int
(
credentials
[
'port'
])
if
'user'
in
credentials
:
#
if 'user' in credentials:
user
=
credentials
[
'user'
]
#
user = credentials['user']
if
'identityfile'
in
credentials
:
if
'identityfile'
in
credentials
:
keypair
=
os
.
path
.
expanduser
(
credentials
[
'identityfile'
])
keypair
=
os
.
path
.
expanduser
(
credentials
[
'identityfile'
])
...
...
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