Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Removed hardcoded git user and protocol #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dusty/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
VM_COMMAND_FILES_DIR = '/command_files'
CONTAINER_COMMAND_FILES_DIR = '/command_files'

GIT_USER = 'git'

HOSTS_PATH = '/etc/hosts'
EXPORTS_PATH = '/etc/exports'

Expand Down
5 changes: 1 addition & 4 deletions dusty/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ def assemble_remote_path(self):
else:
return self.remote_path + '.git'
else:
if self.remote_path.startswith('ssh://'):
return self.remote_path
else:
return 'ssh://{}@{}'.format(constants.GIT_USER, self.remote_path)
return self.remote_path

def ensure_local_repo(self):
"""Given a Dusty repo object, clone the remote into Dusty's local repos
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/source_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def test_git_error_handling(self, fake_log_to_client):
def test_ensure_local_repo_when_does_not_exist(self, fake_clone_from):
temp_dir = os.path.join(self.temp_dir, 'a')
self.MockableRepo.managed_path = property(lambda repo: temp_dir)
self.MockableRepo('github.com/app/a').ensure_local_repo()
fake_clone_from.assert_called_with('ssh://[email protected]/app/a', temp_dir)
self.MockableRepo('git@github.com/app/a').ensure_local_repo()
fake_clone_from.assert_called_with('[email protected]/app/a', temp_dir)

@patch('git.Repo.clone_from')
def test_ensure_local_repo_when_does_not_exist_with_local_remote(self, fake_clone_from):
Expand Down