Skip to content

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Apr 3, 2018
1 parent b6b1c06 commit 1eaba6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion swaggertosdk/SwaggerToSdkMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def generate_sdk(sdk_git_id, base_branch_name,
# No token is provided to clone SDK. Do NOT try to clone a private it will fail.
with tempfile.TemporaryDirectory() as temp_dir:

clone_dir = Path(temp_dir) / Path(global_conf["advanced_options"].get("clone_dir", "sdk"))
clone_dir = Path(temp_dir) / Path(global_conf.get("advanced_options", {}).get("clone_dir", "sdk"))
_LOGGER.info("Clone dir will be: %s", clone_dir)

with manage_git_folder(None, clone_dir, sdk_git_id+'@'+base_branch_name) as sdk_folder:
Expand Down
4 changes: 2 additions & 2 deletions swaggertosdk/SwaggerToSdkNewCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def generate_sdk_from_git_object(git_object, branch_name, restapi_git_id, sdk_gi

# I don't know if the destination branch exists, try until it works
config = None
for branch in base_branch_names + branch_name + fallback_base_branch_name:
for branch in base_branch_names + [branch_name] + [fallback_base_branch_name]:
try:
config = read_config_from_github(sdk_git_id, branch)
except Exception:
Expand All @@ -238,7 +238,7 @@ def generate_sdk_from_git_object(git_object, branch_name, restapi_git_id, sdk_gi

with tempfile.TemporaryDirectory() as temp_dir:

clone_dir = Path(temp_dir) / Path(global_conf["advanced_options"].get("clone_dir", "sdk"))
clone_dir = Path(temp_dir) / Path(global_conf.get("advanced_options", {}).get("clone_dir", "sdk"))
_LOGGER.info("Clone dir will be: %s", clone_dir)

with manage_git_folder(gh_token, Path(temp_dir) / Path("rest"), branched_rest_api_id, pr_number=pr_number) as restapi_git_folder, \
Expand Down

0 comments on commit 1eaba6c

Please sign in to comment.