@@ -52,19 +52,19 @@ def destroy_component(self, application_name, create_data):
52
52
application_name ,
53
53
json .dumps (create_data ))
54
54
# terminate oozie jobs
55
- self ._kill_oozie (create_data ['job_handle' ], create_data [ 'application_user' ] )
55
+ self ._kill_oozie (create_data ['job_handle' ], self . OOZIE_USER_NAME )
56
56
57
57
# delete component from hdfs
58
58
remote_path = create_data ['component_hdfs_root' ][1 :]
59
59
self ._hdfs_client .remove (remote_path , recursive = True )
60
60
61
61
def start_component (self , application_name , create_data ):
62
62
logging .debug ("start_component: %s %s" , application_name , json .dumps (create_data ))
63
- self ._start_oozie (create_data ['job_handle' ], create_data [ 'application_user' ] )
63
+ self ._start_oozie (create_data ['job_handle' ], self . OOZIE_USER_NAME )
64
64
65
65
def stop_component (self , application_name , create_data ):
66
66
logging .debug ("stop_component: %s %s" , application_name , json .dumps (create_data ))
67
- self ._stop_oozie (create_data ['job_handle' ], create_data [ 'application_user' ] )
67
+ self ._stop_oozie (create_data ['job_handle' ], self . OOZIE_USER_NAME )
68
68
69
69
def create_component (self , staged_component_path , application_name , component , properties ):
70
70
logging .debug (
@@ -89,7 +89,7 @@ def create_component(self, staged_component_path, application_name, component, p
89
89
properties ['deployment_end' ] = end .strftime ("%Y-%m-%dT%H:%MZ" )
90
90
91
91
# insert required oozie properties
92
- properties ['user.name' ] = properties [ 'application_user' ]
92
+ properties ['user.name' ] = self . OOZIE_USER_NAME
93
93
# Oozie ShareLib - supports actions
94
94
properties ['oozie.use.system.libpath' ] = 'true'
95
95
# platform shared libs e.g. hbase
@@ -104,15 +104,12 @@ def create_component(self, staged_component_path, application_name, component, p
104
104
properties [def_path ] = '%s/%s' % (self ._environment ['name_node' ], remote_path )
105
105
106
106
# deploy everything to various hadoop services
107
- undeploy = self ._deploy_to_hadoop (properties , staged_component_path , remote_path , properties [ 'application_user' ] )
107
+ undeploy = self ._deploy_to_hadoop (properties , staged_component_path , remote_path )
108
108
109
109
# return something that can be used to undeploy later
110
- return {'job_handle' : undeploy ['id' ],
111
- 'component_hdfs_root' : properties ['component_hdfs_root' ],
112
- 'application_user' : properties ['application_user' ]
113
- }
110
+ return {'job_handle' : undeploy ['id' ], 'component_hdfs_root' : properties ['component_hdfs_root' ]}
114
111
115
- def _deploy_to_hadoop (self , properties , staged_component_path , remote_path , application_user , exclude = None ):
112
+ def _deploy_to_hadoop (self , properties , staged_component_path , remote_path , exclude = None ):
116
113
if exclude is None :
117
114
exclude = []
118
115
exclude .extend (['hdfs.json' ,
@@ -130,7 +127,7 @@ def _deploy_to_hadoop(self, properties, staged_component_path, remote_path, appl
130
127
131
128
# submit to oozie
132
129
result = self ._submit_oozie (properties )
133
- self ._stop_oozie (result ['id' ], application_user )
130
+ self ._stop_oozie (result ['id' ], self . OOZIE_USER_NAME )
134
131
135
132
return result
136
133
0 commit comments