mirror of
https://github.com/ansible/awx.git
synced 2026-07-29 00:49:55 -02:30
awxkit: allow to modify api base url (#14835)
Signed-off-by: Julen Landa Alustiza <jlanda@redhat.com>
This commit is contained in:
committed by
GitHub
parent
8a902debd5
commit
8c9c02c975
@@ -4,6 +4,7 @@ import json
|
||||
from .stdout import monitor, monitor_workflow
|
||||
from .utils import CustomRegistryMeta, color_enabled
|
||||
from awxkit import api
|
||||
from awxkit.config import config
|
||||
from awxkit.exceptions import NoContent
|
||||
|
||||
|
||||
@@ -479,7 +480,7 @@ class RoleMixin(object):
|
||||
options = ', '.join(RoleMixin.roles[flag])
|
||||
raise ValueError("invalid choice: '{}' must be one of {}".format(role, options))
|
||||
value = kwargs[flag]
|
||||
target = '/api/v2/{}/{}'.format(resource, value)
|
||||
target = '{}v2/{}/{}'.format(config.api_base_path, resource, value)
|
||||
detail = self.page.__class__(target, self.page.connection).get()
|
||||
object_roles = detail['summary_fields']['object_roles']
|
||||
actual_role = object_roles[role + '_role']
|
||||
|
||||
@@ -6,6 +6,7 @@ import sys
|
||||
import time
|
||||
|
||||
from .utils import cprint, color_enabled, STATUS_COLORS
|
||||
from awxkit.config import config
|
||||
from awxkit.utils import to_str
|
||||
|
||||
|
||||
@@ -17,7 +18,7 @@ def monitor_workflow(response, session, print_stdout=True, action_timeout=None,
|
||||
}
|
||||
|
||||
def fetch(seen):
|
||||
results = response.connection.get('/api/v2/unified_jobs', payload).json()['results']
|
||||
results = response.connection.get(f"{config.api_base_path}v2/unified_jobs", payload).json()['results']
|
||||
|
||||
# erase lines we've previously printed
|
||||
if print_stdout and sys.stdout.isatty():
|
||||
|
||||
Reference in New Issue
Block a user