Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iotile-ext-cloud 1.1.0 regression #984

Open
mattrunchey opened this issue Jun 23, 2020 · 0 comments
Open

iotile-ext-cloud 1.1.0 regression #984

mattrunchey opened this issue Jun 23, 2020 · 0 comments

Comments

@mattrunchey
Copy link
Contributor

mattrunchey commented Jun 23, 2020

The PR change to modify the way we support verifying a cloud connection (336a3d7#diff-9fe63ecc7aa07c80890100f03619b599L51) means that we can't verify without setting something in the iotile cloud registry:

self._conf.get('cloud:verify-server')

On the broker, we attempt to validate with a command line argument, since using the iotile config ... style is hard to use in that context. Basically, we call:

        cloud = IOTileCloud(retries=5, timeout=(5, 10), verify=args.skip_verify)

It would be nice to still support using verify as a direct argument passed to IOTileCloud instead of forcing it to go through an iotile:config registry value. Something like:

    def __init__(self, domain=None, username=None, arg_verify=None, **kwargs):
        reg = ComponentRegistry()
        self._conf = ConfigManager()

        if domain is None:
            domain = self._conf.get('cloud:server')

        if not self.verify_server:
            urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

        _verify = arg_verify if arg_verify is not None else self.verify_server
        self.api = Api(domain=domain, verify=_verify, **kwargs)
        self._domain = self.api.domain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant