From 67acff678205b98c3bcd2ca3be295c8679c43e91 Mon Sep 17 00:00:00 2001 From: Dmitriy Ulyanov Date: Sun, 15 Nov 2015 00:54:27 +0300 Subject: [PATCH] Removed hardcoded git user and protocol --- dusty/constants.py | 2 -- dusty/source.py | 5 +---- tests/unit/source_test.py | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dusty/constants.py b/dusty/constants.py index 1e07c8b3..1c579e5c 100644 --- a/dusty/constants.py +++ b/dusty/constants.py @@ -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' diff --git a/dusty/source.py b/dusty/source.py index 1f7e8fed..0acc0500 100644 --- a/dusty/source.py +++ b/dusty/source.py @@ -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 diff --git a/tests/unit/source_test.py b/tests/unit/source_test.py index e00fbefa..cf1c9280 100644 --- a/tests/unit/source_test.py +++ b/tests/unit/source_test.py @@ -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://git@github.com/app/a', temp_dir) + self.MockableRepo('git@github.com/app/a').ensure_local_repo() + fake_clone_from.assert_called_with('git@github.com/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):