Changeset - 360abd191aaf
[Not reviewed]
0 2 0
Branko Majic (branko) - 4 years ago 2020-05-07 22:38:53
branko@majic.rs
MAR-149: Use correct mode for opening files in the bootstrap role tests.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
roles/bootstrap/molecule/default/tests/test_parameters_mandatory.py
Show inline comments
 
@@ -14,7 +14,7 @@ def test_authorized_keys(host):
 

	
 
    with host.sudo():
 

	
 
        ssh_key = open(os.path.expanduser('~/.ssh/id_rsa.pub'), 'read').read().strip()
 
        ssh_key = open(os.path.expanduser('~/.ssh/id_rsa.pub'), 'r').read().strip()
 
        authorized_keys = host.file('/home/ansible/.ssh/authorized_keys')
 

	
 
        assert authorized_keys.is_file
 
@@ -28,6 +28,6 @@ def test_root_authorized_keys(host):
 

	
 
    with host.sudo():
 

	
 
        ssh_key = open(os.path.expanduser('~/.ssh/id_rsa.pub'), 'read').read().strip()
 
        ssh_key = open(os.path.expanduser('~/.ssh/id_rsa.pub'), 'r').read().strip()
 

	
 
        assert ssh_key not in host.file('/root/.ssh/authorized_keys').content_string
roles/bootstrap/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -14,7 +14,7 @@ def test_authorized_keys(host):
 

	
 
    with host.sudo():
 

	
 
        ssh_key = open('tests/data/ansible_key.pub', 'read').read().strip()
 
        ssh_key = open('tests/data/ansible_key.pub', 'r').read().strip()
 
        authorized_keys = host.file('/home/ansible/.ssh/authorized_keys')
 

	
 
        assert authorized_keys.is_file
 
@@ -28,6 +28,6 @@ def test_root_authorised_keys(host):
 

	
 
    with host.sudo():
 

	
 
        ssh_key = open('tests/data/ansible_key.pub', 'read').read().strip()
 
        ssh_key = open('tests/data/ansible_key.pub', 'r').read().strip()
 

	
 
        assert ssh_key not in host.file('/root/.ssh/authorized_keys').content_string
0 comments (0 inline, 0 general)