← Back to team overview

sts-sponsors team mailing list archive

Re: [Merge] ~troyanov/maas:describe-maas-url into maas:master

 


Diff comments:

> diff --git a/src/maascli/api.py b/src/maascli/api.py
> index d121309..1b8ef6d 100644
> --- a/src/maascli/api.py
> +++ b/src/maascli/api.py
> @@ -90,7 +90,10 @@ class Action(Command):
>      # Override these in subclasses; see `register_actions`.
>      profile = handler = action = None
>  
> -    uri = property(lambda self: self.handler["uri"])
> +    maas_url = property(lambda self: urlparse(self.profile["url"]))

hmm, should this be public? i.e. why `maas_url` and not `_maas_url`?

given that it's needed for `uri` perhaps we can just use a private one?

Please add tests for it regardless - e.g. what happens if we connect locally?

> +    uri = property(
> +        lambda self: f"{self.maas_url.scheme}://{self.maas_url.netloc}{self.handler['path']}"
> +    )
>      method = property(lambda self: self.action["method"])
>      credentials = property(lambda self: self.profile["credentials"])
>      op = property(lambda self: self.action["op"])


-- 
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/438387
Your team MAAS Committers is subscribed to branch maas:master.



References