step3.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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. secureMapping: require('data/secure_mapping'),
  22. stages: [],
  23. configs: [],
  24. noOfWaitingAjaxCalls: 0,
  25. secureServices: [],
  26. serviceConfigTags: [],
  27. globalProperties: [],
  28. isSubmitDisabled: true,
  29. isBackBtnDisabled: true,
  30. isOozieSelected: function () {
  31. return this.get('content.services').someProperty('serviceName', 'OOZIE');
  32. }.property('content.services'),
  33. isWebHcatSelected: function () {
  34. var installedServices = App.Service.find().mapProperty('serviceName');
  35. return installedServices.contains('WEBHCAT');
  36. },
  37. serviceUsersBinding: 'App.router.mainAdminSecurityController.serviceUsers',
  38. hasHostPopup: true,
  39. services: [],
  40. serviceTimestamp: null,
  41. isSecurityApplied: function () {
  42. return this.get('stages').someProperty('stage', 'stage3') && this.get('stages').findProperty('stage', 'stage3').get('isSuccess');
  43. }.property('stages.@each.isCompleted'),
  44. clearStep: function () {
  45. this.get('stages').clear();
  46. this.set('isSubmitDisabled', true);
  47. this.set('isBackBtnDisabled', true);
  48. this.get('serviceConfigTags').clear();
  49. },
  50. loadStep: function () {
  51. this.set('secureMapping', require('data/secure_mapping').slice(0));
  52. this.clearStep();
  53. var stages = App.db.getSecurityDeployStages();
  54. this.prepareSecureConfigs();
  55. if (stages && stages.length > 0) {
  56. stages.forEach(function (_stage, index) {
  57. stages[index] = App.Poll.create(_stage);
  58. }, this);
  59. if (stages.someProperty('isError', true)) {
  60. var failedStages = stages.filterProperty('isError', true);
  61. failedStages.setEach('isError', false);
  62. failedStages.setEach('isStarted', false);
  63. } else if (stages.filterProperty('isStarted', true).someProperty('isCompleted', false)) {
  64. var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
  65. runningStage.set('isStarted', false);
  66. }
  67. this.get('stages').pushObjects(stages);
  68. } else {
  69. this.loadStages();
  70. this.addInfoToStages();
  71. var runningOperations = App.router.get('backgroundOperationsController.services').filterProperty('isRunning');
  72. var stopAllOperation = runningOperations.findProperty('name', 'Stop All Services');
  73. var stopStage = this.get('stages').findProperty('name', 'STOP_SERVICES');
  74. if (stopStage.get('name') === 'STOP_SERVICES' && stopAllOperation) {
  75. stopStage.set('requestId', stopAllOperation.get('id'));
  76. }
  77. }
  78. this.moveToNextStage();
  79. },
  80. enableSubmit: function () {
  81. if (this.get('stages').someProperty('isError', true) || this.get('stages').everyProperty('isSuccess', true)) {
  82. this.set('isSubmitDisabled', false);
  83. if (this.get('stages').someProperty('isError', true)) {
  84. this.set('isBackBtnDisabled', false);
  85. App.router.get('addSecurityController').setStepsEnable();
  86. }
  87. } else {
  88. this.set('isSubmitDisabled', true);
  89. }
  90. }.observes('stages.@each.isCompleted'),
  91. updateServices: function () {
  92. this.services.clear();
  93. var services = this.get("services");
  94. this.get("stages").forEach(function (stage) {
  95. var newService = Ember.Object.create({
  96. name: stage.label,
  97. hosts: []
  98. });
  99. if (stage && stage.get("polledData")) {
  100. var hostNames = stage.get("polledData").mapProperty('Tasks.host_name').uniq();
  101. hostNames.forEach(function (name) {
  102. newService.hosts.push({
  103. name: name,
  104. publicName: name,
  105. logTasks: stage.polledData.filterProperty("Tasks.host_name", name)
  106. });
  107. });
  108. services.push(newService);
  109. }
  110. });
  111. this.set('serviceTimestamp', new Date().getTime());
  112. }.observes('stages.@each.polledData'),
  113. loadStages: function () {
  114. this.get('stages').pushObjects([
  115. App.Poll.create({stage: 'stage2', label: Em.I18n.translations['admin.addSecurity.apply.stage2'], isPolling: true, name: 'STOP_SERVICES'}),
  116. App.Poll.create({stage: 'stage3', label: Em.I18n.translations['admin.addSecurity.apply.stage3'], isPolling: false, name: 'APPLY_CONFIGURATIONS'}),
  117. App.Poll.create({stage: 'stage4', label: Em.I18n.translations['admin.addSecurity.apply.stage4'], isPolling: true, name: 'START_SERVICES'})
  118. ]);
  119. },
  120. startStage: function () {
  121. var startedStages = this.get('stages').filterProperty('isStarted', true);
  122. if (startedStages.length) {
  123. var currentStage = startedStages.findProperty('isCompleted', false);
  124. if (currentStage && currentStage.get('isPolling') === true) {
  125. currentStage.start();
  126. } else if (currentStage && currentStage.get('stage') === 'stage3') {
  127. if (App.testMode) {
  128. currentStage.set('isSuccess', true);
  129. App.router.get('mainAdminSecurityController').setAddSecurityWizardStatus(null);
  130. } else {
  131. this.loadClusterConfigs()
  132. }
  133. }
  134. }
  135. }.observes('stages.@each.isStarted'),
  136. onCompleteStage: function () {
  137. var index = this.get('stages').filterProperty('isCompleted', true).length;
  138. if (index > 0) {
  139. var lastCompletedStageResult = this.get('stages').objectAt(index - 1).get('isSuccess');
  140. if (lastCompletedStageResult) {
  141. this.moveToNextStage();
  142. }
  143. }
  144. }.observes('stages.@each.isCompleted'),
  145. moveToNextStage: function () {
  146. var leftStages = this.get('stages').filterProperty('isStarted', false);
  147. var nextStage = leftStages.findProperty('isCompleted', false);
  148. if (nextStage) {
  149. nextStage.set('isStarted', true);
  150. }
  151. },
  152. addInfoToStages: function () {
  153. this.addInfoToStage2();
  154. this.addInfoToStage4();
  155. },
  156. addInfoToStage1: function () {
  157. var stage1 = this.get('stages').findProperty('stage', 'stage1');
  158. if (App.testMode) {
  159. stage1.set('isSuccess', true);
  160. stage1.set('isStarted', true);
  161. stage1.set('isCompleted', true);
  162. }
  163. },
  164. addInfoToStage2: function () {
  165. var stage2 = this.get('stages').findProperty('stage', 'stage2');
  166. var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services';
  167. var data = '{"RequestInfo": {"context" :"' + Em.I18n.t('requestInfo.stopAllServices') + '"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
  168. stage2.set('url', url);
  169. stage2.set('data', data);
  170. },
  171. addInfoToStage4: function () {
  172. var stage4 = this.get('stages').findProperty('stage', 'stage4');
  173. var url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services?params/run_smoke_test=true';
  174. var data = '{"RequestInfo": {"context": "' + Em.I18n.t('requestInfo.startAllServices') + '"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}';
  175. stage4.set('url', url);
  176. stage4.set('data', data);
  177. },
  178. loadUiSideConfigs: function () {
  179. var uiConfig = [];
  180. var configs = this.get('secureMapping').filterProperty('foreignKey', null);
  181. configs.forEach(function (_config) {
  182. var value = this.getGlobConfigValue(_config.templateName, _config.value, _config.name);
  183. uiConfig.pushObject({
  184. "id": "site property",
  185. "name": _config.name,
  186. "value": value,
  187. "filename": _config.filename
  188. });
  189. }, this);
  190. var dependentConfig = this.get('secureMapping').filterProperty('foreignKey');
  191. dependentConfig.forEach(function (_config) {
  192. this.setConfigValue(uiConfig, _config);
  193. uiConfig.pushObject({
  194. "id": "site property",
  195. "name": _config._name || _config.name,
  196. "value": _config.value,
  197. "filename": _config.filename
  198. });
  199. }, this);
  200. return uiConfig;
  201. },
  202. appendInstanceName: function (name, property) {
  203. var newValue;
  204. if (this.get('globalProperties').someProperty('name', name)) {
  205. var globalProperty = this.get('globalProperties').findProperty('name', name);
  206. newValue = globalProperty.value;
  207. var isInstanceName = this.get('globalProperties').findProperty('name', 'instance_name').value;
  208. if (isInstanceName === true || isInstanceName === 'true') {
  209. if (/primary_name?$/.test(globalProperty.name) && property !== 'hadoop.security.auth_to_local' && property !== 'oozie.authentication.kerberos.name.rules') {
  210. if (this.get('isOozieSelected') && (property === 'oozie.service.HadoopAccessorService.kerberos.principal' || property === 'oozie.authentication.kerberos.principal')) {
  211. var oozieServerName = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
  212. newValue = newValue + '/' + oozieServerName;
  213. } else if (this.isWebHcatSelected() && (property === 'templeton.kerberos.principal')) {
  214. var webHcatName = App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName', 'WEBHCAT_SERVER').get('host.hostName');
  215. newValue = newValue + '/' + webHcatName;
  216. } else {
  217. if (!/_HOST?$/.test(newValue)) {
  218. newValue = newValue + '/_HOST';
  219. }
  220. }
  221. }
  222. }
  223. } else {
  224. console.log("The template name does not exist in secure_properties file");
  225. newValue = null;
  226. }
  227. return newValue;
  228. },
  229. /**
  230. * Set all site property that are derived from other puppet-variable
  231. */
  232. getGlobConfigValue: function (templateName, expression, name) {
  233. var express = expression.match(/<(.*?)>/g);
  234. var value = expression;
  235. if (express == null) {
  236. return expression;
  237. }
  238. express.forEach(function (_express) {
  239. //console.log("The value of template is: " + _express);
  240. var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
  241. if (this.get('globalProperties').someProperty('name', templateName[index])) {
  242. //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name', templateName[index]).name);
  243. var globValue = this.appendInstanceName(templateName[index], name);
  244. console.log('The template value of templateName ' + '[' + index + ']' + ': ' + templateName[index] + ' is: ' + globValue);
  245. 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
  246. value = value.replace(_express, globValue);
  247. }
  248. } else {
  249. /*
  250. console.log("ERROR: The variable name is: " + templateName[index]);
  251. console.log("ERROR: mapped config from secureMapping file has no corresponding variable in " +
  252. "content.serviceConfigProperties. Two possible reasons for the error could be: 1) The service is not selected. " +
  253. "and/OR 2) The service_config metadata file has no corresponding global var for the site property variable");
  254. */
  255. value = null;
  256. }
  257. }, this);
  258. return value;
  259. },
  260. /**
  261. * Set all site property that are derived from other site-properties
  262. */
  263. setConfigValue: function (uiConfig, config) {
  264. if (config.value == null) {
  265. return;
  266. }
  267. var fkValue = config.name.match(/<(foreignKey.*?)>/g);
  268. if (fkValue) {
  269. fkValue.forEach(function (_fkValue) {
  270. var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
  271. var globalValue
  272. if (uiConfig.someProperty('name', config.foreignKey[index])) {
  273. globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
  274. config._name = config.name.replace(_fkValue, globalValue);
  275. } else if (this.get('content.serviceConfigProperties').someProperty('name', config.foreignKey[index])) {
  276. if (this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value === '') {
  277. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).defaultValue;
  278. } else {
  279. globalValue = this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value;
  280. }
  281. config._name = config.name.replace(_fkValue, globalValue);
  282. }
  283. }, this);
  284. }
  285. //For properties in the configMapping file having foreignKey and templateName properties.
  286. var templateValue = config.value.match(/<(templateName.*?)>/g);
  287. if (templateValue) {
  288. templateValue.forEach(function (_value) {
  289. var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
  290. if (this.get('globalProperties').someProperty('name', config.templateName[index])) {
  291. var globValue = this.appendInstanceName(config.templateName[index]);
  292. config.value = config.value.replace(_value, globValue);
  293. } else {
  294. config.value = null;
  295. }
  296. }, this);
  297. }
  298. },
  299. prepareSecureConfigs: function () {
  300. this.loadGlobals();
  301. var storedConfigs = this.get('content.serviceConfigProperties').filterProperty('id', 'site property');
  302. var uiConfigs = this.loadUiSideConfigs();
  303. this.set('configs', storedConfigs.concat(uiConfigs));
  304. },
  305. loadGlobals: function () {
  306. var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
  307. this.set('globalProperties', globals);
  308. this.loadStaticGlobal(); //Hack for properties which are declared in config_properties.js and not able to retrieve values declared in secure_properties.js
  309. this.loadUsersToGlobal();
  310. this.loadHostNamesToGlobal();
  311. },
  312. loadUsersToGlobal: function () {
  313. if (!this.get('serviceUsers').length) {
  314. this.loadUsersFromServer();
  315. }
  316. App.router.get('mainAdminSecurityController.serviceUsers').forEach(function (_user) {
  317. this.get('globalProperties').pushObject(_user);
  318. }, this);
  319. },
  320. loadHostNamesToGlobal: function () {
  321. if (this.get('isOozieSelected')) {
  322. var oozieHostName = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.hostName');
  323. this.get('globalProperties').pushObject({
  324. id: 'puppet var',
  325. name: 'oozieserver_host',
  326. value: oozieHostName
  327. });
  328. }
  329. if (App.Service.find('HIVE')) {
  330. var hiveHostName = App.Service.find('HIVE').get('hostComponents').findProperty('componentName', 'HIVE_METASTORE').get('host.hostName');
  331. this.get('globalProperties').pushObject({
  332. id: 'puppet var',
  333. name: 'hivemetastore_host',
  334. value: hiveHostName
  335. });
  336. }
  337. },
  338. loadStaticGlobal: function () {
  339. var globalProperties = this.get('globalProperties');
  340. this.get('globalProperties').forEach(function (_property) {
  341. switch (_property.name) {
  342. case 'security_enabled':
  343. _property.value = 'true';
  344. break;
  345. case 'dfs_datanode_address':
  346. _property.value = '1019';
  347. break;
  348. case 'dfs_datanode_http_address':
  349. _property.value = '1022';
  350. break;
  351. }
  352. }, this);
  353. },
  354. loadUsersFromServer: function () {
  355. if (App.testMode) {
  356. var serviceUsers = this.get('serviceUsers');
  357. serviceUsers.pushObject({id: 'puppet var', name: 'hdfs_user', value: 'hdfs'});
  358. serviceUsers.pushObject({id: 'puppet var', name: 'mapred_user', value: 'mapred'});
  359. serviceUsers.pushObject({id: 'puppet var', name: 'hbase_user', value: 'hbase'});
  360. serviceUsers.pushObject({id: 'puppet var', name: 'hive_user', value: 'hive'});
  361. } else {
  362. App.router.get('mainAdminSecurityController').setSecurityStatus();
  363. }
  364. },
  365. loadClusterConfigs: function () {
  366. var self = this;
  367. var url = App.apiPrefix + '/clusters/' + App.router.getClusterName();
  368. App.ajax.send({
  369. name: 'admin.security.add.cluster_configs',
  370. sender: this,
  371. success: 'loadClusterConfigsSuccessCallback',
  372. error: 'loadClusterConfigsErrorCallback'
  373. });
  374. },
  375. loadClusterConfigsSuccessCallback: function (data) {
  376. var self = this;
  377. //prepare tags to fetch all configuration for a service
  378. this.get('content.services').forEach(function (_secureService) {
  379. self.setServiceTagNames(_secureService, data.Clusters.desired_configs);
  380. });
  381. this.getAllConfigurations();
  382. },
  383. loadClusterConfigsErrorCallback: function (request, ajaxOptions, error) {
  384. this.get('stages').findProperty('stage', 'stage3').set('isError', true);
  385. console.log("TRACE: error code status is: " + request.status);
  386. },
  387. /**
  388. * set tagnames for configuration of the *-site.xml
  389. */
  390. setServiceTagNames: function (secureService, configs) {
  391. //var serviceConfigTags = this.get('serviceConfigTags');
  392. for (var index in configs) {
  393. if (secureService.sites && secureService.sites.contains(index)) {
  394. var serviceConfigObj = {
  395. siteName: index,
  396. tagName: configs[index].tag,
  397. newTagName: null,
  398. configs: {}
  399. };
  400. console.log("The value of serviceConfigTags[index]: " + configs[index]);
  401. this.get('serviceConfigTags').pushObject(serviceConfigObj);
  402. }
  403. }
  404. return serviceConfigObj;
  405. },
  406. applyConfigurationsToCluster: function () {
  407. this.set('noOfWaitingAjaxCalls', this.get('serviceConfigTags').length);
  408. this.get('serviceConfigTags').forEach(function (_serviceConfig) {
  409. this.applyConfigurationToCluster({type: _serviceConfig.siteName, tag: _serviceConfig.newTagName, properties: _serviceConfig.configs});
  410. }, this);
  411. },
  412. applyConfigurationToCluster: function (data) {
  413. var clusterData = {
  414. Clusters: {
  415. desired_config: data
  416. }
  417. };
  418. App.ajax.send({
  419. name: 'admin.security.apply_configuration',
  420. sender: this,
  421. data: {
  422. clusterData: clusterData
  423. },
  424. success: 'applyConfigurationToClusterSuccessCallback',
  425. error: 'applyConfigurationToClusterErrorCallback'
  426. });
  427. },
  428. applyConfigurationToClusterSuccessCallback: function (data) {
  429. this.set('noOfWaitingAjaxCalls', this.get('noOfWaitingAjaxCalls') - 1);
  430. if (this.get('noOfWaitingAjaxCalls') == 0) {
  431. var currentStage = this.get('stages').findProperty('stage', 'stage3');
  432. currentStage.set('isSuccess', true);
  433. }
  434. },
  435. applyConfigurationToClusterErrorCallback: function (request, ajaxOptions, error) {
  436. this.get('stages').findProperty('stage', 'stage3').set('isError', true);
  437. },
  438. /**
  439. * gets site config properties from server and sets it for every configuration
  440. * @param serviceConfigTags
  441. */
  442. getAllConfigurations: function () {
  443. var urlParams = [];
  444. this.get('serviceConfigTags').forEach(function (_tag) {
  445. urlParams.push('(type=' + _tag.siteName + '&tag=' + _tag.tagName + ')');
  446. }, this);
  447. if (urlParams.length > 0) {
  448. App.ajax.send({
  449. name: 'admin.security.all_configurations',
  450. sender: this,
  451. data: {
  452. urlParams: urlParams.join('|')
  453. },
  454. success: 'getAllConfigurationsSuccessCallback',
  455. error: 'getAllConfigurationsErrorCallback'
  456. });
  457. }
  458. },
  459. getAllConfigurationsSuccessCallback: function (data) {
  460. console.log("TRACE: In success function for the GET getServiceConfigsFromServer call");
  461. this.get('serviceConfigTags').forEach(function (_tag) {
  462. if (!data.items.someProperty('type', _tag.siteName)) {
  463. console.log("Error: Metadata for secure services (secure_configs.js) is having config tags that are not being retrieved from server");
  464. this.get('stages').findProperty('stage', 'stage3').set('isError', true);
  465. }
  466. _tag.configs = data.items.findProperty('type', _tag.siteName).properties;
  467. }, this);
  468. this.addSecureConfigs();
  469. this.applyConfigurationsToCluster();
  470. },
  471. getAllConfigurationsErrorCallback: function (request, ajaxOptions, error) {
  472. this.get('stages').findProperty('stage', 'stage3').set('isError', true);
  473. console.log("TRACE: In error function for the getServiceConfigsFromServer call");
  474. console.log("TRACE: error code status is: " + request.status);
  475. },
  476. addSecureConfigs: function () {
  477. this.get('serviceConfigTags').forEach(function (_serviceConfigTags, index) {
  478. _serviceConfigTags.newTagName = 'version' + (new Date).getTime();
  479. if (_serviceConfigTags.siteName === 'global') {
  480. this.get('globalProperties').forEach(function (_globalProperty) {
  481. _serviceConfigTags.configs[_globalProperty.name] = _globalProperty.value;
  482. }, this);
  483. }
  484. else {
  485. this.get('configs').filterProperty('id', 'site property').filterProperty('filename', _serviceConfigTags.siteName + '.xml').forEach(function (_config) {
  486. _serviceConfigTags.configs[_config.name] = _config.value;
  487. }, this);
  488. }
  489. }, this);
  490. },
  491. saveStages: function () {
  492. var stages = [];
  493. this.get('stages').forEach(function (_stage) {
  494. var stage = {
  495. name: _stage.get('name'),
  496. stage: _stage.get('stage'),
  497. label: _stage.get('label'),
  498. isPolling: _stage.get('isPolling'),
  499. isStarted: _stage.get('isStarted'),
  500. requestId: _stage.get('requestId'),
  501. isSuccess: _stage.get('isSuccess'),
  502. isError: _stage.get('isError'),
  503. url: _stage.get('url'),
  504. polledData: _stage.get('polledData'),
  505. data: _stage.get('data')
  506. };
  507. stages.pushObject(stage);
  508. }, this);
  509. App.db.setSecurityDeployStages(stages);
  510. }.observes('stages.@each.requestId', 'stages.@each.isStarted', 'stages.@each.isCompleted')
  511. });