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
7b8d1c0f
Commit
7b8d1c0f
authored
Mar 25, 2014
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6580 from ramondelafuente/fix-vault-editor-call
Changed call to EDITOR to allow for parameters
parents
c9bf7eb9
c79c001b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lib/ansible/utils/vault.py
+10
-4
No files found.
lib/ansible/utils/vault.py
View file @
7b8d1c0f
...
...
@@ -19,6 +19,7 @@
# installs ansible and sets it up to run on cron.
import
os
import
shlex
import
shutil
import
tempfile
from
io
import
BytesIO
...
...
@@ -190,8 +191,7 @@ class VaultEditor(object):
raise
errors
.
AnsibleError
(
"
%
s exists, please use 'edit' instead"
%
self
.
filename
)
# drop the user into vim on file
EDITOR
=
os
.
environ
.
get
(
'EDITOR'
,
'vim'
)
call
([
EDITOR
,
self
.
filename
])
call
(
self
.
_editor_shell_command
(
self
.
filename
))
tmpdata
=
self
.
read_data
(
self
.
filename
)
this_vault
=
VaultLib
(
self
.
password
)
this_vault
.
cipher_name
=
self
.
cipher_name
...
...
@@ -230,8 +230,7 @@ class VaultEditor(object):
self
.
write_data
(
dec_data
,
tmp_path
)
# drop the user into vim on the tmp file
EDITOR
=
os
.
environ
.
get
(
'EDITOR'
,
'vim'
)
call
([
EDITOR
,
tmp_path
])
call
(
self
.
_editor_shell_command
(
tmp_path
))
new_data
=
self
.
read_data
(
tmp_path
)
# create new vault
...
...
@@ -303,6 +302,13 @@ class VaultEditor(object):
os
.
remove
(
dest
)
shutil
.
move
(
src
,
dest
)
def
_editor_shell_command
(
self
,
filename
):
EDITOR
=
os
.
environ
.
get
(
'EDITOR'
,
'vim'
)
editor
=
shlex
.
split
(
EDITOR
)
editor
.
append
(
filename
)
return
editor
########################################
# CIPHERS #
########################################
...
...
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