Skip to content

Commit

Permalink
use app.ct.io and not api host
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwwarren committed Apr 23, 2024
1 parent fdb5634 commit b51074c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/dynamic_importer/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

DEFAULT_API_HOST = "api.cloudtruth.io"
SUCCESS_CODES = {"get": 200, "post": 201, "patch": 200, "put": 200, "delete": 204}
CLOUDTRUTH_API_HOST = os.environ.get("CLOUDTRUTH_API_HOST", DEFAULT_API_HOST)


class CTClient:
def __init__(self, api_key, skip_ssl_validation=False):
api_host = CLOUDTRUTH_API_HOST
api_host = os.environ.get("CLOUDTRUTH_API_HOST", DEFAULT_API_HOST)
self.base_url = f"https://{api_host}/api/v1"
self.api_key = api_key
self.headers = {"Authorization": f"Api-Key {self.api_key}"}
Expand Down
3 changes: 1 addition & 2 deletions src/dynamic_importer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import click
import urllib3
from dynamic_importer.api.client import CLOUDTRUTH_API_HOST
from dynamic_importer.api.client import CTClient
from dynamic_importer.api.types import coerce_types
from dynamic_importer.processors import BaseProcessor
Expand Down Expand Up @@ -211,7 +210,7 @@ def _create_data(
if not api_key:
raise click.UsageError(

Check warning on line 211 in src/dynamic_importer/main.py

View check run for this annotation

Codecov / codecov/patch

src/dynamic_importer/main.py#L211

Added line #L211 was not covered by tests
"CLOUDTRUTH_API_KEY environment variable is required. "
f"Please visit https://{CLOUDTRUTH_API_HOST}/organization/api to generate one."
"Please visit https://app.cloudtruth.io/organization/api to generate one."
)
if k:
urllib3.disable_warnings()
Expand Down

0 comments on commit b51074c

Please sign in to comment.