Skip to content

Commit

Permalink
fix: fixed pylint & flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anaik91 committed Jan 26, 2025
1 parent 119bcbe commit 9cb6c5c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions nextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ def __init__(self, project_id, token, env_type):
self.token = token
self.env_type = env_type or 'ENVIRONMENT_TYPE_UNSPECIFIED'
self.org_object_map = {
'apis': { 'key': 'proxies', 'subkey': 'name' },
'sharedflows': { 'key': 'sharedFlows', 'subkey': 'name' },
'envgroups': { 'key': 'environmentGroups', 'subkey': 'name' },
'apps': { 'key': 'app', 'subkey': 'appId' },
'developers': { 'key': 'developer', 'subkey': 'email' },
'keyvaluemaps': { 'key': None, 'subkey': None },
'environments': { 'key': None, 'subkey': None },
'apis': {'key': 'proxies', 'subkey': 'name'},
'sharedflows': {'key': 'sharedFlows', 'subkey': 'name'},
'envgroups': {'key': 'environmentGroups', 'subkey': 'name'},
'apps': {'key': 'app', 'subkey': 'appId'},
'developers': {'key': 'developer', 'subkey': 'email'},
'keyvaluemaps': {'key': None, 'subkey': None},
'environments': {'key': None, 'subkey': None},
}
self.env_objects = ['keyvaluemaps', 'targetservers', 'flowhooks', 'keystores'
'caches']
self.env_objects = ['keyvaluemaps', 'targetservers', 'flowhooks',
'keystores', 'caches']
self.client = RestClient('oauth', token)

def get_org(self):
Expand All @@ -72,13 +72,13 @@ def list_org_objects(self, org_object_type):
list: A list containing the org object details.
"""
org_objects = []
url = f"{self.baseurl}/organizations/{self.project_id}/{org_object_type}"
url = f"{self.baseurl}/organizations/{self.project_id}/{org_object_type}" # noqa
org_objects_data = self.client.get(url)
if isinstance(org_objects_data, list):
org_objects.extend(org_objects_data)
if isinstance(org_objects_data, dict):
org_objects_list = org_objects_data.get(
self.org_object_map.get(org_object_type).get('key'))
self.org_object_map.get(org_object_type).get('key')) # noqa
for each_object in org_objects_list:
org_objects.append(
each_object.get(
Expand All @@ -94,7 +94,7 @@ def list_env_objects(self, env, env_object_type):
list: A list containing the env object details.
"""
env_objects = []
url = f"{self.baseurl}/organizations/{self.project_id}/environments/{env}/{env_object_type}"
url = f"{self.baseurl}/organizations/{self.project_id}/environments/{env}/{env_object_type}" # noqa pylint: disable=C0301
env_objects = self.client.get(url)
return env_objects

Expand Down

0 comments on commit 9cb6c5c

Please sign in to comment.