Commit 272441b8 authored by Nik Khlestov's avatar Nik Khlestov

Dropped workaround for bad ssl.

parent 2fc732bb
Pipeline #17605 passed with stage
in 34 seconds
......@@ -8,7 +8,7 @@ def readme():
setup(
name='uptr',
version='0.0.7',
version='0.0.8',
description='Command line interface for update tracker.',
long_description=readme(),
long_description_content_type="text/markdown",
......
......@@ -18,9 +18,6 @@ class ClientConfiguration(Configuration):
address = 'https://uptr.teonite.net'
project_id = 0
# TODO: turn this off when we have correct https credentials
import urllib3
urllib3.disable_warnings()
settings = ClientConfiguration.load()
session = requests.Session()
......
......@@ -41,7 +41,7 @@ def upsert(ctx, distname, master_site, package_version):
to omit writing a site.
"""
url = settings.address + '/api/projects/%s/packages/' % ctx.obj['project_id']
resp = session.post(url, verify=False, data={
resp = session.post(url, data={
'distname': distname,
'master_site': master_site,
'version': package_version
......@@ -51,7 +51,6 @@ def upsert(ctx, distname, master_site, package_version):
elif resp.status_code == 200:
click.echo('UPDATED')
else:
import ipdb; ipdb.set_trace()
click.echo('FAIL')
sys.exit(1)
......@@ -103,7 +102,7 @@ def list(ctx):
Format (tab-delimited): name, current version, latest version, master site, id.
"""
url = settings.address + '/api/projects/%s/packages/' % ctx.obj['project_id']
resp = session.get(url, verify=False)
resp = session.get(url)
data = resp.json()
echo_data = []
for item in data:
......@@ -127,7 +126,7 @@ def list(ctx):
def delete(ctx, package_id):
"""Stop tracking a package."""
url = settings.address + '/api/projects/%s/packages/%s' % (ctx.obj['project_id'], package_id)
resp = session.delete(url, verify=False)
resp = session.delete(url)
if resp.status_code == 404:
click.echo('NO PACKAGE')
sys.exit(1)
......
......@@ -18,7 +18,7 @@ def project():
def start(name):
"""Track new project."""
url = settings.address + '/api/projects/'
resp = session.post(url, data={'name': name}, verify=False)
resp = session.post(url, data={'name': name})
if resp.status_code != 201:
click.get_current_context().fail(message='Failed to create new project')
sys.exit(1)
......@@ -39,7 +39,7 @@ def list():
List all tracked projects.\n
Format (tab-delimited): name, id, is_pinned. """
url = settings.address + '/api/projects/'
resp = session.get(url, verify=False).json()
resp = session.get(url).json()
notification_message = []
for p in resp:
is_pinned_mark = 'PINNED' if int(p['id']) == settings.project_id else ''
......
......@@ -16,7 +16,7 @@ def user():
@click.option('--password', '-p', envvar='PASSWORD', required=True)
def register(email, password):
url = settings.address + '/api/auth/register/'
resp = session.post(url, verify=False, data={
resp = session.post(url, data={
'email': email,
'password': password,
'password_confirm': password,
......@@ -35,7 +35,7 @@ def register(email, password):
@click.option('--signature', '-s', required=True)
def verify(user_uuid, timestamp, signature):
url = settings.address + '/api/auth/verify-registration/'
resp = session.post(url, verify=False, data={
resp = session.post(url, data={
'user_id': user_uuid,
'timestamp': timestamp,
'signature': signature,
......@@ -52,7 +52,7 @@ def verify(user_uuid, timestamp, signature):
@click.option('--password', '-p', envvar='PASSWORD', required=True)
def login(email, password):
url = settings.address + '/api/auth/login/'
resp = session.post(url, verify=False, data={
resp = session.post(url, data={
'login': email,
'password': password
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment