Skip to content

Commit

Permalink
Merge pull request #15 from pbortlov/fix-iiblib-imports
Browse files Browse the repository at this point in the history
Fix imports from iiblib [CLOUDDST-3064]
  • Loading branch information
lipoja committed Oct 19, 2020
2 parents f6069ec + 6787f08 commit 79f9ddc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
8 changes: 3 additions & 5 deletions pubtools/iib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
import sys
import pkg_resources

from iiblib import iibclient
from iiblib import iib_client, iib_authentication
from pubtools import pulplib

from iiblib.iibclient import IIBBuildDetailsModel


def setup_iib_client(parsed_args):
iib_auth = iibclient.IIBKrbAuth(
iib_auth = iib_authentication.IIBKrbAuth(
parsed_args.iib_krb_principal,
parsed_args.iib_server,
ktfile=parsed_args.iib_krb_ktfile,
Expand All @@ -21,7 +19,7 @@ def setup_iib_client(parsed_args):
}
if parsed_args.iib_insecure:
kwargs["ssl_verify"] = False
iibc = iibclient.IIBClient(parsed_args.iib_server, **kwargs)
iibc = iib_client.IIBClient(parsed_args.iib_server, **kwargs)
return iibc


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ setuptools
pyrsistent<=0.16.0; python_version == '2.7'
pushcollector
pubtools-pulp
iiblib>=0.9.0
iiblib>=0.13.0
pubtools-pulplib
6 changes: 3 additions & 3 deletions tests/test_iib_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pushcollector


from iiblib.iibclient import IIBBuildDetailsModel
from iiblib.iib_build_details_model import IIBBuildDetailsModel
from pubtools.pulplib import ContainerImageRepository
from more_executors.futures import f_return

Expand Down Expand Up @@ -65,7 +65,7 @@ def setup_entry_point_py(entry_tuple, environ_vars):

@pytest.fixture
def fixture_iib_client():
with mock.patch("iiblib.iibclient.IIBClient") as iibc_patched:
with mock.patch("iiblib.iib_client.IIBClient") as iibc_patched:
iibc_patched.return_value.add_bundles.side_effect = (
lambda *args, **kwargs: IIBBuildDetailsModel.from_dict(
fake_tm.setup_task(*args, **kwargs)
Expand Down Expand Up @@ -97,7 +97,7 @@ def fixture_pushcollector():

@pytest.fixture
def fixture_iib_krb_auth():
with mock.patch("iiblib.iibclient.IIBKrbAuth") as iib_krbauth_patched:
with mock.patch("iiblib.iib_authentication.IIBKrbAuth") as iib_krbauth_patched:
iib_krbauth_patched.return_value = mock.MagicMock(name="MockedIIBKrbAuth")
yield iib_krbauth_patched

Expand Down
3 changes: 0 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from iiblib.iibclient import IIBBuildDetailsModel


class FakeTaskManager(object):
def __init__(self):
self.tasks = {}
Expand Down

0 comments on commit 79f9ddc

Please sign in to comment.