Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
fix-string-bug-in-windows (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaozha authored Jul 22, 2020
1 parent 3207bbb commit 5b3fa18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 14 additions & 2 deletions src/plugins/azgenerator/TemplateAzureCliCustom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,13 @@ function GetPolyMethodCall(model: CodeModelAz, prefix: any, originalOperation: O
parameterPair = model.Parameter_NamePython(param) + "=None";
}
} else {
parameterPair = parameterName + "=" + optionName;
if(model.Parameter_Type(param) == SchemaType.Integer) {
parameterPair = parameterName + "=int(" + optionName + ")";
} else if(model.Parameter_Type(param) == SchemaType.Number) {
parameterPair = parameterName + "=float(" + optionName + ")";
} else {
parameterPair = parameterName + "=" + optionName;
}
}


Expand Down Expand Up @@ -561,7 +567,13 @@ function GetMethodCall(model: CodeModelAz, required: any, prefix: any): string[]
}
}
else {
parameterPair = model.MethodParameter_NamePython + "=" + model.MethodParameter_MapsTo;
if(model.MethodParameter_Type == SchemaType.Integer) {
parameterPair = model.MethodParameter_NamePython + "=int(" + model.MethodParameter_MapsTo + ")";
} else if(model.MethodParameter_Type == SchemaType.Number) {
parameterPair = model.MethodParameter_NamePython + "=float(" + model.MethodParameter_MapsTo + ")";
} else {
parameterPair = model.MethodParameter_NamePython + "=" + model.MethodParameter_MapsTo;
}
}

if (methodCall.endsWith("(")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def managed_network_mn_list(client,
skiptoken=None):
if resource_group_name:
return client.list_by_resource_group(resource_group_name=resource_group_name,
top=top,
top=int(top),
skiptoken=skiptoken)
return client.list_by_subscription(top=top,
return client.list_by_subscription(top=int(top),
skiptoken=skiptoken)


Expand Down Expand Up @@ -109,7 +109,7 @@ def managed_network_mn_group_list(client,
skiptoken=None):
return client.list_by_managed_network(resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
top=top,
top=int(top),
skiptoken=skiptoken)


Expand Down Expand Up @@ -185,7 +185,7 @@ def managed_network_managed_network_peering_policy_list(client,
skiptoken=None):
return client.list_by_managed_network(resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
top=top,
top=int(top),
skiptoken=skiptoken)


Expand Down

0 comments on commit 5b3fa18

Please sign in to comment.