mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 05:30:18 -03:30
Add new inventory--empty source vars
The source variable parsing was out of date, and wasn't using the updated parser that I fixed to accept empty variables.
This commit is contained in:
@@ -373,7 +373,7 @@ InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeP
|
|||||||
|
|
||||||
function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
||||||
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, OrganizationList, SearchInit, PaginateInit,
|
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, GenerateList, OrganizationList, SearchInit, PaginateInit,
|
||||||
LookUpInit, GetBasePath, ParseTypeChange, Wait) {
|
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -415,17 +415,7 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
try {
|
try {
|
||||||
var fld, json_data, data;
|
var fld, json_data, data;
|
||||||
|
|
||||||
// Make sure we have valid variable data
|
json_data = ToJSON($scope.parseType, $scope.variables, true);
|
||||||
if ( $scope.inventoryParseType === 'json') {
|
|
||||||
json_data = JSON.parse( $scope.variables); //make sure JSON parses
|
|
||||||
} else {
|
|
||||||
json_data = jsyaml.load( $scope.variables); //parse yaml
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure our JSON is actually an object
|
|
||||||
if (typeof json_data !== 'object') {
|
|
||||||
throw "failed to return an object!";
|
|
||||||
}
|
|
||||||
|
|
||||||
data = {};
|
data = {};
|
||||||
for (fld in form.fields) {
|
for (fld in form.fields) {
|
||||||
@@ -486,7 +476,7 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
|
|
||||||
InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
||||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList', 'OrganizationList', 'SearchInit',
|
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'GenerateList', 'OrganizationList', 'SearchInit',
|
||||||
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait'
|
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user