diff --git a/awxkit/awxkit/api/pages/page.py b/awxkit/awxkit/api/pages/page.py index fb21c26ea2..7e714bbb05 100644 --- a/awxkit/awxkit/api/pages/page.py +++ b/awxkit/awxkit/api/pages/page.py @@ -166,13 +166,13 @@ class Page(object): return self.__class__ @classmethod - def from_json(cls, raw): + def from_json(cls, raw, connection=None): resp = Response() data = json.dumps(raw) resp._content = bytes(data, 'utf-8') resp.encoding = 'utf-8' resp.status_code = 200 - return cls(r=resp) + return cls(r=resp, connection=connection) def page_identity(self, response, request_json=None): """Takes a `requests.Response` and @@ -283,7 +283,7 @@ class Page(object): json['results'] = [] for page in paged_results: json['results'].extend(page) - page = self.__class__.from_json(json) + page = self.__class__.from_json(json, connection=self.connection) return page def head(self): diff --git a/awxkit/awxkit/cli/resource.py b/awxkit/awxkit/cli/resource.py index 6937ab1f95..152b9a1cbb 100644 --- a/awxkit/awxkit/cli/resource.py +++ b/awxkit/awxkit/cli/resource.py @@ -177,7 +177,7 @@ def parse_resource(client, skip_deprecated=False): } _filter = 'key, value' formatted = format_response( - Page.from_json(response), + Page.from_json(response, connection=client.root.connection), fmt=client.get_config('format'), filter=_filter )