def sanity_checks(self, nuke):
print(snakesay('Running API sanity checks'))
token = os.environ.get('API_TOKEN')
if not token:
raise SanityException(dedent(
'''
Could not find your API token.
You may need to create it on the Accounts page?
You will also need to close this console and open a new one once you've done that.
'''
))
if nuke:
return
url = API_ENDPOINT.format(username=getpass.getuser()) + self.domain + '/'
response = call_api(url, 'get')
if response.status_code == 200:
raise SanityException(f'You already have a webapp for {self.domain}.\n\nUse the --nuke option if you want to replace it.')
评论列表
文章目录