step3.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
  20. name: 'mainAdminSecurityAddStep3Controller',
  21. configMapping: require('data/secure_mapping'),
  22. stages: [],
  23. configs: [],
  24. noOfWaitingAjaxCalls: 0,
  25. secureServices: [],
  26. serviceConfigTags: [],
  27. globalProperties: [],
  28. isSubmitDisabled: true,
  29. isOozieSelected: function () {
  30. return this.get('content.services').someProperty('serviceName', 'OOZIE');
  31. }.property('content.services'),
  32. isWebHcatSelected: function () {
  33. return this.get('content.services').someProperty('serviceName', 'WEBHCAT');
  34. }.property('content.services'),
  35. serviceUsersBinding: 'App.router.mainAdminController.serviceUsers',
  36. hasHostPopup:true,
  37. services:[],
  38. serviceTimestamp: null,
  39. clearStep: function () {
  40. this.get('stages').clear();
  41. this.set('isSubmitDisabled',true);
  42. },
  43. loadStep: function () {
  44. this.clearStep();
  45. this.loadStages();
  46. this.addInfoToStages();
  47. this.prepareSecureConfigs();
  48. this.moveToNextStage();
  49. },
  50. updateServices: function () {
  51. this.services.clear();
  52. var services = this.get("services");
  53. this.get("stages").forEach(function(stages){
  54. var newService = Ember.Object.create({
  55. name:stages.label,
  56. hosts:[]
  57. });
  58. var hostNames = stages.get("polledData").mapProperty('Tasks.host_name').uniq();
  59. hostNames.forEach(function(name){
  60. newService.hosts.push({
  61. name:name,
  62. publicName:name,
  63. logTasks:stages.polledData
  64. });
  65. });
  66. services.push(newService);
  67. });
  68. this.set('serviceTimestamp', new Date().getTime());
  69. }.observes("stages.@each.polledData"),
  70. loadStages: function () {
  71. this.get('stages').pushObjects([
  72. App.Poll.create({stage: 'stage2', label: Em.I18n.translations['admin.addSecurity.apply.stage2'], isPolling: true}),
  73. App.Poll.create({stage: 'stage3', label: Em.I18n.translations['admin.addSecurity.apply.stage3'], isPolling: false}),
  74. App.Poll.create({stage: 'stage4', label: Em.I18n.translations['admin.addSecurity.apply.stage4'], isPolling: true})
  75. ]);
  76. },
  77. startStage: function () {
  78. var startedStages = this.get('stages').filterProperty('isStarted', true);
  79. if (startedStages.length) {
  80. var currentStage = startedStages.findProperty('isCompleted', false);
  81. if (currentStage && currentStage.get('isPolling') === true) {
  82. currentStage.start();
  83. } else if (currentStage && currentStage.get('stage') === 'stage3') {
  84. if (App.testMode) {
  85. currentStage.set('isSuccess', true);
  86. currentStage.set('isCompleted', true);
  87. this.moveToNextStage();
  88. } else {
  89. this.loadConfigsForAllServices();
  90. }
  91. }
  92. }
  93. }.observes('stages.@each.isStarted'),
  94. onCompleteStage: function () {
  95. var index = this.get('stages').filterProperty('isCompleted', true).length;
  96. if (index > 0) {
  97. var self = this;
  98. var lastCompletedStageResult = this.get('stages').objectAt(index - 1).get('isSuccess');
  99. if (lastCompletedStageResult) {
  100. window.setTimeout(function () {
  101. self.moveToNextStage();
  102. }, 50);
  103. }
  104. }
  105. }.observes('stages.@each.isCompleted'),
  106. addInfoToStages: function () {
  107. this.addInfoToStage2();
  108. this.addInfoToStage3();
  109. this.addInfoToStage4();
  110. },
  111. addInfoToStage1: function () {
  112. var stage1 = this.get('stages').findProperty('stage', 'stage1');
  113. if (App.testMode) {
  114. stage1.set('isSuccess', true);
  115. stage1.set('isStarted', true);
  116. stage1.set('isCompleted', true);
  117. }
  118. },
  119. addInfoToStage2: function () {
  120. var stage2 = this.get('stages').findProperty('stage', 'stage2');
  121. var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
  122. var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
  123. stage2.set('url', url);
  124. stage2.set('data', data);
  125. },
  126. addInfoToStage3: function () {
  127. },
  128. addInfoToStage4: function () {
  129. var stage4 = this.get('stages').findProperty('stage', 'stage4');
  130. var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
  131. var data = '{"ServiceInfo": {"state": "STARTED"}}';
  132. stage4.set('url', url);
  133. stage4.set('data', data);
  134. },
  135. loadUiSideConfigs: function () {
  136. var uiConfig = [];
  137. var configs = this.get('configMapping').filterProperty('foreignKey', null);
  138. configs.forEach(function (_config) {
  139. var value = this.getGlobConfigValue(_config.templateName, _config.value, _config.name);
  140. uiConfig.pushObject({
  141. "id": "site property",
  142. "name": _config.name,
  143. "value": value,
  144. "filename": _config.filename
  145. });
  146. }, this);
  147. var dependentConfig = this.get('configMapping').filterProperty('foreignKey');
  148. dependentConfig.forEach(function (_config) {
  149. this.setConfigValue(uiConfig, _config);
  150. uiConfig.pushObject({
  151. "id": "site property",
  152. "name": _config.name,
  153. "value": _config.value,
  154. "filename": _config.filename
  155. });
  156. }, this);
  157. return uiConfig;
  158. },
  159. appendInstanceName: function (name, property) {
  160. var newValue;
  161. if (this.get('globalProperties').someProperty('name', name)) {
  162. var globalProperty = this.get('globalProperties').findProperty('name', name);
  163. newValue = globalProperty.value;
  164. var isInstanceName = this.get('globalProperties').findProperty('name', 'instance_name');
  165. if (isInstanceName) {
  166. if (/primary_name?$/.test(globalProperty.name) && property !== 'hadoop.security.auth_to_local' && property !== 'oozie.authentication.kerberos.name.rules') {
  167. if (this.get('isOozieSelected') && (property === 'oozie.service.HadoopAccessorService.kerberos.principal' || property === 'oozie.authentication.kerberos.principal')) {
  168. var oozieServerName = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
  169. newValue = newValue + '/' + oozieServerName;
  170. } else if (this.get('isWebHcatSelected') && property === 'templeton.kerberos.principal') {
  171. var webHcatName = App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName', 'WEBHCAT_SERVER').get('host.hostName');
  172. newValue = newValue + '/' + webHcatName;
  173. } else {
  174. if (!/_HOST?$/.test(newValue)) {
  175. newValue = newValue + '/_HOST';
  176. }
  177. }
  178. }
  179. }
  180. } else {
  181. console.log("The template name does not exist in secure_properties file");
  182. newValue = null;
  183. }
  184. return newValue;
  185. },
  186. /**
  187. * Set all site property that are derived from other puppet-variable
  188. */
  189. getGlobConfigValue: function (templateName, expression, name) {
  190. var express = expression.match(/<(.*?)>/g);
  191. var value = expression;
  192. if (express == null) {
  193. return expression;
  194. }
  195. express.forEach(function (_express) {
  196. //console.log("The value of template is: " + _express);
  197. var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
  198. if (this.get('globalProperties').someProperty('name', templateName[index])) {
  199. //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
  200. var globValue = this.appendInstanceName(templateName[index], name);
  201. console.log('The template value of templateName ' + '[' + index + ']' + ': ' + templateName[index] + ' is: ' + globValue);
  202. if (value !== null) { // if the property depends on more than one template name like <templateName[0]>/<templateName[1]> then don't proceed to the next if the prior is null or not found in the global configs
  203. value = value.replace(_express, globValue);
  204. }
  205. } else {
  206. /*
  207. console.log("ERROR: The variable name is: " + templateName[index]);
  208. console.log("ERROR: mapped config from configMapping file has no corresponding variable in " +
  209. "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
  210. "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
  211. */
  212. value = null;
  213. }
  214. }, this);
  215. return value;
  216. },
  217. /**
  218. * Set all site property that are derived from other site-properties
  219. */
  220. setConfigValue: function (uiConfig, config) {
  221. if (config.value == null) {
  222. return;
  223. }
  224. var fkValue = config.value.match(/<(foreignKey.*?)>/g);
  225. if (fkValue) {
  226. fkValue.forEach(function (_fkValue) {
  227. var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
  228. if (uiConfig.someProperty('name', config.foreignKey[index])) {
  229. var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
  230. config.value = config.value.replace(_fkValue, globalValue);
  231. } else if (this.get('content.serviceConfigProperties').someProperty('name', config.foreignKey[index])) {
  232. var globalValue;
  233. if (this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value === '') {
  234. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).defaultValue;
  235. } else {
  236. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value;
  237. }
  238. config.value = config.value.replace(_fkValue, globalValue);
  239. }
  240. }, this);
  241. }
  242. if (fkValue = config.name.match(/<(foreignKey.*?)>/g)) {
  243. fkValue.forEach(function (_fkValue) {
  244. var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
  245. if (uiConfig.someProperty('name', config.foreignKey[index])) {
  246. var globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
  247. config.name = config.name.replace(_fkValue, globalValue);
  248. } else if (this.get('content.serviceConfigProperties').someProperty('name', config.foreignKey[index])) {
  249. var globalValue;
  250. if (this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value === '') {
  251. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).defaultValue;
  252. } else {
  253. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value;
  254. }
  255. config.name = config.name.replace(_fkValue, globalValue);
  256. }
  257. }, this);
  258. }
  259. //For properties in the configMapping file having foreignKey and templateName properties.
  260. var templateValue = config.value.match(/<(templateName.*?)>/g);
  261. if (templateValue) {
  262. templateValue.forEach(function (_value) {
  263. var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
  264. if (this.get('globalProperties').someProperty('name', config.templateName[index])) {
  265. var globValue = this.appendInstanceName(config.templateName[index]);
  266. config.value = config.value.replace(_value, globValue);
  267. } else {
  268. config.value = null;
  269. }
  270. }, this);
  271. }
  272. },
  273. prepareSecureConfigs: function () {
  274. this.loadGlobals();
  275. var storedConfigs = this.get('content.serviceConfigProperties').filterProperty('id', 'site property');
  276. var uiConfigs = this.loadUiSideConfigs();
  277. this.set('configs', storedConfigs.concat(uiConfigs));
  278. },
  279. loadGlobals: function () {
  280. var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
  281. this.set('globalProperties', globals);
  282. this.loadUsersToGlobal();
  283. },
  284. loadUsersToGlobal: function () {
  285. if (!this.get('serviceUsers').length) {
  286. this.loadUsersFromServer();
  287. }
  288. App.router.get('mainAdminController.serviceUsers').forEach(function (_user) {
  289. this.get('globalProperties').pushObject(_user);
  290. }, this);
  291. },
  292. loadUsersFromServer: function () {
  293. var self = this;
  294. if (App.testMode) {
  295. var serviceUsers = this.get('serviceUsers');
  296. serviceUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'});
  297. serviceUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'});
  298. serviceUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'});
  299. serviceUsers.pushObject({id: 'puppet var', name: 'hive_user', value: 'hive'});
  300. } else {
  301. App.router.get('mainAdminController').getHDFSDetailsFromServer();
  302. }
  303. },
  304. loadConfigsForAllServices: function () {
  305. this.set('noOfWaitingAjaxCalls', this.get('content.services').length - 1);
  306. this.get('content.services').forEach(function (_secureService, index) {
  307. if (_secureService.serviceName !== 'GENERAL') {
  308. this.getConfigDetailsFromServer(_secureService, index);
  309. }
  310. }, this);
  311. },
  312. getConfigDetailsFromServer: function (secureService, id) {
  313. var self = this;
  314. var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services/' + secureService.serviceName;
  315. $.ajax({
  316. type: 'GET',
  317. url: url,
  318. timeout: 10000,
  319. dataType: 'text',
  320. success: function (data) {
  321. console.log("TRACE: In success function for the GET getServciceConfigs call");
  322. console.log("TRACE: The url is: " + url);
  323. var jsonData = jQuery.parseJSON(data);
  324. //prepare tags to fetch all configuration for a service
  325. self.setServiceTagNames(secureService.serviceName, jsonData.ServiceInfo.desired_configs);
  326. self.set('noOfWaitingAjaxCalls', self.get('noOfWaitingAjaxCalls') - 1);
  327. if (self.get('noOfWaitingAjaxCalls') == 0) {
  328. self.getAllConfigsFromServer();
  329. }
  330. },
  331. error: function (request, ajaxOptions, error) {
  332. self.get('stages').findProperty('stage', 'stage3').set('isError', true);
  333. console.log("TRACE: In error function for the getServciceConfigs call");
  334. console.log("TRACE: value of the url is: " + url);
  335. console.log("TRACE: error code status is: " + request.status);
  336. },
  337. statusCode: require('data/statusCodes')
  338. });
  339. },
  340. /**
  341. * set tagnames for configuration of the *-site.xml
  342. */
  343. setServiceTagNames: function (secureServiceName, configs) {
  344. console.log("TRACE: In setServiceTagNames function:");
  345. //var serviceConfigTags = this.get('serviceConfigTags');
  346. for (var index in configs) {
  347. var serviceConfigObj = {
  348. serviceName: secureServiceName,
  349. siteName: index,
  350. tagName: configs[index],
  351. newTagName: null,
  352. configs: {}
  353. };
  354. console.log("The value of serviceConfigTags[index]: " + configs[index]);
  355. this.get('serviceConfigTags').pushObject(serviceConfigObj);
  356. }
  357. return serviceConfigObj;
  358. },
  359. getAllConfigsFromServer: function () {
  360. this.set('noOfWaitingAjaxCalls', this.get('serviceConfigTags').length - 1);
  361. this.get('serviceConfigTags').forEach(function (_serviceConfigTags) {
  362. if (_serviceConfigTags.serviceName !== 'MAPREDUCE' || _serviceConfigTags.siteName !== 'core-site') { //skip MapReduce core-site configuration
  363. this.getServiceConfigsFromServer(_serviceConfigTags);
  364. }
  365. }, this);
  366. },
  367. createConfigurations: function () {
  368. this.set('noOfWaitingAjaxCalls', this.get('serviceConfigTags').length - 1);
  369. this.get('serviceConfigTags').forEach(function (_serviceConfigTags) {
  370. if (_serviceConfigTags.serviceName !== 'MAPREDUCE' || _serviceConfigTags.siteName !== 'core-site') { //skip MapReduce core-site configuration
  371. this.createConfiguration(_serviceConfigTags);
  372. }
  373. }, this);
  374. },
  375. createConfiguration: function (serviceConfigTags) {
  376. var self = this;
  377. var clusterName = App.router.getClusterName();
  378. var url = App.apiPrefix + '/clusters/' + clusterName + '/configurations';
  379. var data = this.createConfigurationData(serviceConfigTags);
  380. $.ajax({
  381. type: 'POST',
  382. url: url,
  383. data: JSON.stringify(data),
  384. dataType: 'text',
  385. timeout: 5000,
  386. success: function (data) {
  387. var jsonData = jQuery.parseJSON(data);
  388. self.set('noOfWaitingAjaxCalls', self.get('noOfWaitingAjaxCalls') - 1);
  389. if (self.get('noOfWaitingAjaxCalls') == 0) {
  390. self.applyConfigurationToServices();
  391. }
  392. },
  393. error: function (request, ajaxOptions, error) {
  394. self.get('stages').findProperty('stage', 'stage3').set('isError', true);
  395. console.log('TRACE: In Error ');
  396. console.log('TRACE: Error message is: ' + request.responseText);
  397. console.log("TRACE: value of the url is: " + url);
  398. },
  399. statusCode: require('data/statusCodes')
  400. });
  401. },
  402. createConfigurationData: function (serviceConfigTags) {
  403. return {"type": serviceConfigTags.siteName, "tag": serviceConfigTags.newTagName, "properties": serviceConfigTags.configs};
  404. },
  405. applyConfigurationToServices: function () {
  406. this.applyHdfsCoretoMaprCore();
  407. this.set('noOfWaitingAjaxCalls', this.get('content.services').length - 1);
  408. this.set('noOfWaitingAjaxCalls', this.get('content.services').length - 1);
  409. this.get('content.services').forEach(function (_service) {
  410. if (_service.serviceName !== 'GENERAL') {
  411. var data = {config: {}};
  412. this.get('serviceConfigTags').filterProperty('serviceName', _service.serviceName).forEach(function (_serviceConfig) {
  413. data.config[_serviceConfig.siteName] = _serviceConfig.newTagName;
  414. }, this);
  415. this.applyConfToService(_service.serviceName, data);
  416. }
  417. }, this);
  418. },
  419. applyHdfsCoretoMaprCore: function () {
  420. this.get('serviceConfigTags').filterProperty('serviceName', 'MAPREDUCE').findProperty('siteName', 'core-site').newTagName = this.get('serviceConfigTags').filterProperty('serviceName', 'HDFS').findProperty('siteName', 'core-site').newTagName;
  421. },
  422. applyConfToService: function (serviceName, data) {
  423. var self = this;
  424. var clusterName = App.router.getClusterName();
  425. var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + serviceName;
  426. $.ajax({
  427. type: 'PUT',
  428. url: url,
  429. async: false,
  430. dataType: 'text',
  431. data: JSON.stringify(data),
  432. timeout: 5000,
  433. success: function (data) {
  434. var jsonData = jQuery.parseJSON(data);
  435. console.log("TRACE: In success function for the applyCreatedConfToService call");
  436. console.log("TRACE: value of the url is: " + url);
  437. self.set('noOfWaitingAjaxCalls', self.get('noOfWaitingAjaxCalls') - 1);
  438. if (self.get('noOfWaitingAjaxCalls') == 0) {
  439. var currentStage = self.get('stages').findProperty('stage', 'stage3');
  440. currentStage.set('isSuccess', true);
  441. currentStage.set('isCompleted', true);
  442. }
  443. },
  444. error: function (request, ajaxOptions, error) {
  445. self.get('stages').findProperty('stage', 'stage3').set('isError', true);
  446. console.log('Error: In Error of apply');
  447. console.log('Error: Error message is: ' + request.responseText);
  448. },
  449. statusCode: require('data/statusCodes')
  450. });
  451. console.log("Exiting applyCreatedConfToService");
  452. },
  453. moveToNextStage: function () {
  454. var nextStage = this.get('stages').findProperty('isStarted', false);
  455. if (nextStage) {
  456. nextStage.set('isStarted', true);
  457. this.set('isSubmitDisabled', true);
  458. } else {
  459. this.set('isSubmitDisabled', false);
  460. }
  461. },
  462. /**
  463. * gets site config properties from server and sets it for every configuration
  464. * @param serviceConfigTags
  465. */
  466. getServiceConfigsFromServer: function (serviceConfigTags) {
  467. var self = this;
  468. var properties = {};
  469. var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/configurations/?type=' + serviceConfigTags.siteName + '&tag=' + serviceConfigTags.tagName;
  470. $.ajax({
  471. type: 'GET',
  472. url: url,
  473. async: true,
  474. timeout: 10000,
  475. dataType: 'json',
  476. success: function (data) {
  477. console.log("TRACE: In success function for the GET getServiceConfigsFromServer call");
  478. console.log("TRACE: The url is: " + url);
  479. serviceConfigTags.configs = data.items.findProperty('tag', serviceConfigTags.tagName).properties;
  480. self.set('noOfWaitingAjaxCalls', self.get('noOfWaitingAjaxCalls') - 1);
  481. if (self.get('noOfWaitingAjaxCalls') == 0) {
  482. self.addSecureConfigs();
  483. self.createConfigurations();
  484. }
  485. },
  486. error: function (request, ajaxOptions, error) {
  487. self.get('stages').findProperty('stage', 'stage3').set('isError', true);
  488. console.log("TRACE: In error function for the getServiceConfigsFromServer call");
  489. console.log("TRACE: value of the url is: " + url);
  490. console.log("TRACE: error code status is: " + request.status);
  491. },
  492. statusCode: require('data/statusCodes')
  493. });
  494. },
  495. addSecureConfigs: function () {
  496. this.get('serviceConfigTags').forEach(function (_serviceConfigTags, index) {
  497. if (_serviceConfigTags.siteName === 'global') {
  498. _serviceConfigTags.newTagName = 'version' + (new Date).getTime() + index;
  499. this.get('globalProperties').forEach(function (_globalProperty) {
  500. _serviceConfigTags.configs[_globalProperty.name] = _globalProperty.value;
  501. }, this);
  502. } else {
  503. _serviceConfigTags.newTagName = 'version' + (new Date).getTime();
  504. this.get('configs').filterProperty('id', 'site property').filterProperty('filename', _serviceConfigTags.siteName + '.xml').forEach(function (_config) {
  505. _serviceConfigTags.configs[_config.name] = _config.value;
  506. }, this);
  507. }
  508. }, this);
  509. }
  510. });