Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Commit

Permalink
use clickclick.UrlType
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Dec 10, 2015
1 parent 70bba5b commit f1c5618
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions pierone/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import requests
import time
import zign.api
from clickclick import error, AliasedGroup, print_table, OutputFormat
from clickclick import error, AliasedGroup, print_table, OutputFormat, UrlType

from .api import docker_login, request, get_latest_tag, DockerImage
import pierone
Expand Down Expand Up @@ -62,9 +62,7 @@ def set_pierone_url(config: dict, url: str) -> None:
url = url or config.get('url')

while not url:
url = click.prompt('Please enter the Pier One URL')
if not url.startswith('http'):
url = 'https://{}'.format(url)
url = click.prompt('Please enter the Pier One URL', type=UrlType())

try:
requests.get(url, timeout=5)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
clickclick>=0.9
clickclick>=1.0
keyring
requests
stups-zign>=1.0.13
Expand Down

0 comments on commit f1c5618

Please sign in to comment.