mirror of
https://github.com/ansible/awx.git
synced 2026-05-22 16:27:42 -02:30
Fix the _create_assets method to use _get_options
This commit is contained in:
@@ -8,7 +8,7 @@ from . import base
|
|||||||
from . import page
|
from . import page
|
||||||
from ..mixins import has_create
|
from ..mixins import has_create
|
||||||
|
|
||||||
descRE = re.compile('^[*] `(\w+)`: [^(]*\((\w+), ([^)]+)\)')
|
descRE = re.compile(r'^[*] `(\w+)`: [^(]*\((\w+), ([^)]+)\)')
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ class ApiV2(base.Base):
|
|||||||
fields['natural_key'] = asset.get_natural_key()
|
fields['natural_key'] = asset.get_natural_key()
|
||||||
|
|
||||||
for key in options:
|
for key in options:
|
||||||
if not key in asset.related:
|
if key not in asset.related:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
# FIXME: use caching by url
|
# FIXME: use caching by url
|
||||||
@@ -242,7 +242,7 @@ class ApiV2(base.Base):
|
|||||||
return
|
return
|
||||||
|
|
||||||
endpoint = getattr(self, resource)
|
endpoint = getattr(self, resource)
|
||||||
options = self._options[resource]
|
options = self._get_options(endpoint)
|
||||||
assets = data[resource]
|
assets = data[resource]
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
post_data = {}
|
post_data = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user