1
0
Fork 0

calling update_interfaces

This commit is contained in:
Christian Kühnel 2020-01-20 12:06:57 +01:00
parent da4237c666
commit fe615f19bb

View file

@ -51,7 +51,7 @@ class ApplyPatch:
self.diff_json_path = store_json_diff # type: str self.diff_json_path = store_json_diff # type: str
if not self.host.endswith('/api/'): if not self.host.endswith('/api/'):
self.host += '/api/' self.host += '/api/'
self.phab = Phabricator(token=self.conduit_token, host=self.host) self.phab = self._create_phab()
self.git_hash = None # type: Optional[str] self.git_hash = None # type: Optional[str]
self.msg = [] # type: List[str] self.msg = [] # type: List[str]
self.repo = Repo(os.getcwd()) # type: Repo self.repo = Repo(os.getcwd()) # type: Repo
@ -90,6 +90,11 @@ class ApplyPatch:
finally: finally:
self._write_error_message() self._write_error_message()
def _create_phab():
phab = Phabricator(token=self.conduit_token, host=self.host)
self._phab.update_interfaces()
return phab
def _get_diff(self, diff_id: str): def _get_diff(self, diff_id: str):
"""Get a diff from Phabricator based on it's diff id.""" """Get a diff from Phabricator based on it's diff id."""
return self.phab.differential.getdiff(diff_id=diff_id) return self.phab.differential.getdiff(diff_id=diff_id)