Skip to content

Commit

Permalink
Merge pull request #150 from NeowayLabs/improveRouteDelete
Browse files Browse the repository at this point in the history
avoid aborting on route delete
  • Loading branch information
katcipis authored Aug 7, 2017
2 parents 4cbe3bc + c4a041b commit 68becf8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions azure/route.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn azure_route_table_create(name, group, location) {
fn azure_route_table_delete(name, group) {
out, status <= azure network route-table delete -q --name $name --resource-group $group
if $status != "0" {
return format("error[%s] deleting route[%s] from resgroup[%s]", $out, $name, $group)
return format("error[%s] deleting route table[%s] from resgroup[%s]", $out, $name, $group)
}
return ""
}
Expand Down Expand Up @@ -101,12 +101,24 @@ fn azure_route_table_add_route(name, group, routetable, address, hoptype, hopadd
}

fn azure_route_table_delete_route(name, group, routetable) {
(
out, status <= (
azure network route-table route delete
-q
--name $name
--resource-group $group
--route-table-name $routetable
)
if $status != "0" {
return format(
"error[%s] deleting route[%s] from resgroup[%s] route table[%s]",
$out,
$name,
$group,
$routetable
)
}

return ""
}

# azure_route_table_route_get_id will return the route ID.
Expand Down

0 comments on commit 68becf8

Please sign in to comment.