Skip to content

Commit fdc748f

Browse files
fix #239 , use python-style templating instead of Jinja in the plugins login_cmd_template (#240)
fix #239 , use python-style templating instead of Jinja in all drivers login_cmd_template This file assumes Jinja templating for the port parameter and passes a Jinja-style "{{ port }}". https://github.com/ansible/molecule/blob/main/src/molecule/command/login.py#L105 When it reaches molecule, it is subsituted in this file and is done by python calling `.format()` on the string. That causes it to not render correctly and gives users issues running molecule login. ref: #239 Fixed all affected plugins.
1 parent 5ab90a0 commit fdc748f

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/molecule_plugins/azure/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ def login_cmd_template(self):
9090
connection_options = " ".join(self.ssh_connection_options)
9191

9292
return (
93-
"ssh {{address}} "
94-
"-l {{user}} "
95-
"-p {{port}} "
96-
"-i {{identity_file}} "
93+
"ssh {address} "
94+
"-l {user} "
95+
"-p {port} "
96+
"-i {identity_file} "
9797
f"{connection_options}"
9898
)
9999

src/molecule_plugins/ec2/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ def login_cmd_template(self):
195195
connection_options = " ".join(self.ssh_connection_options)
196196

197197
return (
198-
"ssh {{address}} "
199-
"-l {{user}} "
200-
"-p {{port}} "
201-
"-i {{identity_file}} "
198+
"ssh {address} "
199+
"-l {user} "
200+
"-p {port} "
201+
"-i {identity_file} "
202202
f"{connection_options}"
203203
)
204204

src/molecule_plugins/gce/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ def login_cmd_template(self):
9494
connection_options = " ".join(self.ssh_connection_options)
9595

9696
return (
97-
"ssh {{address}} "
98-
"-l {{user}} "
99-
"-p {{port}} "
100-
"-i {{identity_file}} "
97+
"ssh {address} "
98+
"-l {user} "
99+
"-p {port} "
100+
"-i {identity_file} "
101101
f"{connection_options}"
102102
)
103103

src/molecule_plugins/vagrant/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ def login_cmd_template(self):
149149
connection_options = " ".join(self.ssh_connection_options)
150150

151151
return (
152-
"ssh {{address}} "
153-
"-l {{user}} "
154-
"-p {{port}} "
155-
"-i {{identity_file}} "
152+
"ssh {address} "
153+
"-l {user} "
154+
"-p {port} "
155+
"-i {identity_file} "
156156
f"{connection_options}"
157157
)
158158

0 commit comments

Comments
 (0)