Skip to content

Commit 690dd61

Browse files
committed
clean up
1 parent f8e3a61 commit 690dd61

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

describe.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,18 @@ def document_api(
406406
If this parameter is set, the `uri` parameter is ignored and the uri
407407
will be created from this template.
408408
"""
409-
# Use the discovery_uri_template to create the uri if provided
409+
# Use the discovery_uri_template to create the uri if provided,
410+
# ignoring the `uri` argument of `document_api`
410411
if discovery_uri_template:
411412
uri = uritemplate.expand(
412413
discovery_uri_template, {"api": name, "apiVersion": version}
413414
)
414-
415-
uri = uri or uritemplate.expand(
416-
FLAGS.discovery_uri_template, {"api": name, "apiVersion": version}
417-
)
415+
else:
416+
# Use `uri` argument of `document_api` or
417+
# create the uri from `FLAGS.discovery_uri_template`
418+
uri = uri or uritemplate.expand(
419+
FLAGS.discovery_uri_template, {"api": name, "apiVersion": version}
420+
)
418421

419422
http = build_http()
420423
resp, content = http.request(uri)

0 commit comments

Comments
 (0)