Merge "Fix chown command for tripleo validation."
This commit is contained in:
commit
afc399096c
1
sudoers
1
sudoers
@ -3,7 +3,6 @@ Defaults:validations !requiretty
|
||||
Defaults:mistral !requiretty
|
||||
mistral ALL = (validations) NOPASSWD:SETENV: /usr/bin/run-validation
|
||||
mistral ALL = NOPASSWD: /usr/bin/chown -h validations\: /tmp/validations_identity_[A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_], \
|
||||
/usr/bin/chown validations\: /tmp/validations_identity_[A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_], \
|
||||
!/usr/bin/chown /tmp/validations_identity_* *, !/usr/bin/chown /tmp/validations_identity_*..*
|
||||
mistral ALL = NOPASSWD: /usr/bin/rm -f /tmp/validations_identity_[A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_][A-Za-z0-9_], \
|
||||
!/usr/bin/rm /tmp/validations_identity_* *, !/usr/bin/rm /tmp/validations_identity_*..*
|
||||
|
@ -101,7 +101,8 @@ class ValidationsKeyTest(base.TestCase):
|
||||
mock_open_context.assert_called_once_with('fd', 'w')
|
||||
mock_open_context().write.assert_called_once_with('private_key')
|
||||
mock_execute.assert_called_once_with(
|
||||
'/usr/bin/sudo', '/usr/bin/chown', 'validations:', 'tmp_path')
|
||||
'/usr/bin/sudo', '/usr/bin/chown', '-h', 'validations:',
|
||||
'tmp_path')
|
||||
|
||||
@mock.patch("oslo_concurrency.processutils.execute")
|
||||
def test_cleanup_identity_file(self, mock_execute):
|
||||
|
@ -97,8 +97,8 @@ def write_identity_file(key):
|
||||
LOG.debug('Writing SSH key to disk at %s', path)
|
||||
with os.fdopen(fd, 'w') as tmp:
|
||||
tmp.write(key)
|
||||
processutils.execute('/usr/bin/sudo', '/usr/bin/chown', 'validations:',
|
||||
path)
|
||||
processutils.execute('/usr/bin/sudo', '/usr/bin/chown', '-h',
|
||||
'validations:', path)
|
||||
return path
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user