Skip to content

Commit ced0b00

Browse files
authored
Merge pull request #74 from pndaproject/PNDA-4525
Deprecate Ubuntu 14.04
2 parents 5670e4e + 3595b7a commit ced0b00

File tree

4 files changed

+5
-32
lines changed

4 files changed

+5
-32
lines changed

api/src/main/resources/plugins/sparkStreaming.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def _control_component(self, cmds):
7070
def create_component(self, staged_component_path, application_name, user_name, component, properties):
7171
logging.debug("create_component: %s %s %s %s", application_name, user_name, json.dumps(component), properties)
7272
distro = platform.dist()
73-
usesSystemd = distro[0] in ('redhat', 'centos')
7473
remote_component_tmp_path = '%s/%s/%s' % (
7574
'/tmp/%s' % self._namespace, application_name, component['component_name'])
7675
remote_component_install_path = '%s/%s/%s' % (
@@ -108,12 +107,8 @@ def create_component(self, staged_component_path, application_name, user_name, c
108107

109108
this_dir = os.path.dirname(os.path.realpath(__file__))
110109
copy(os.path.join(this_dir, 'yarn-kill.py'), staged_component_path)
111-
if usesSystemd:
112-
service_script = 'systemd.service.tpl' if java_app else 'systemd.service.py.tpl'
113-
service_script_install_path = '/usr/lib/systemd/system/%s.service' % service_name
114-
else:
115-
service_script = 'upstart.conf.tpl' if java_app else 'upstart.conf.py.tpl'
116-
service_script_install_path = '/etc/init/%s.conf' % service_name
110+
service_script = 'systemd.service.tpl' if java_app else 'systemd.service.py.tpl'
111+
service_script_install_path = '/usr/lib/systemd/system/%s.service' % service_name
117112
copy(os.path.join(this_dir, service_script), staged_component_path)
118113

119114
self._fill_properties(os.path.join(staged_component_path, service_script), properties)
@@ -153,8 +148,7 @@ def create_component(self, staged_component_path, application_name, user_name, c
153148
logging.debug("uninstall commands: %s", undo_commands)
154149

155150
start_commands = []
156-
if usesSystemd:
157-
start_commands.append('sudo systemctl daemon-reload\n')
151+
start_commands.append('sudo systemctl daemon-reload\n')
158152
start_commands.append('sudo service %s start\n' % service_name)
159153
logging.debug("start commands: %s", start_commands)
160154

api/src/main/resources/plugins/upstart.conf.py.tpl

Lines changed: 0 additions & 10 deletions
This file was deleted.

api/src/main/resources/plugins/upstart.conf.tpl

Lines changed: 0 additions & 11 deletions
This file was deleted.

api/src/main/resources/test_application_creator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def json(self):
193193
return {'id': 'someid'}
194194

195195
post_mock.return_value = Resp()
196-
dist_mock.return_value = 'ubuntu'
196+
dist_mock.return_value = 'redhat'
197197
cmd_mock.return_value = (0, 'dev')
198198
with patch("__builtin__.open", mock_open(read_data="[]")):
199199
creator = ApplicationCreator(self.config, self.environment, self.service)
@@ -211,7 +211,7 @@ def json(self):
211211
exec_ssh_mock.assert_any_call('nm1', 'root_user', 'keyfile.pem', ['sudo mkdir -p /opt/ns/aname/componentC', 'sudo mv /tmp/ns/aname/componentC/log4j.properties /opt/ns/aname/componentC/log4j.properties'])
212212
exec_ssh_mock.assert_any_call('nm2', 'root_user', 'keyfile.pem', ['mkdir -p /tmp/ns/aname/componentC'])
213213
exec_ssh_mock.assert_any_call('nm2', 'root_user', 'keyfile.pem', ['sudo mkdir -p /opt/ns/aname/componentC', 'sudo mv /tmp/ns/aname/componentC/log4j.properties /opt/ns/aname/componentC/log4j.properties'])
214-
exec_ssh_mock.assert_any_call('localhost', 'root_user', 'keyfile.pem', ['sudo cp /tmp/ns/aname/componentC/upstart.conf.tpl /etc/init/ns-aname-componentC.conf', 'sudo cp /tmp/ns/aname/componentC/* /opt/ns/aname/componentC', 'sudo chmod a+x /opt/ns/aname/componentC/yarn-kill.py', 'cd /opt/ns/aname/componentC && sudo jar uf abc.jar application.properties', 'sudo rm -rf /tmp/ns/aname/componentC'])
214+
exec_ssh_mock.assert_any_call('localhost', 'root_user', 'keyfile.pem', ['sudo cp /tmp/ns/aname/componentC/systemd.service.tpl /usr/lib/systemd/system/ns-aname-componentC.service', 'sudo cp /tmp/ns/aname/componentC/* /opt/ns/aname/componentC', 'sudo chmod a+x /opt/ns/aname/componentC/yarn-kill.py', 'cd /opt/ns/aname/componentC && sudo jar uf abc.jar application.properties', 'sudo rm -rf /tmp/ns/aname/componentC'])
215215

216216
@patch('starbase.Connection')
217217
@patch('pyhs2.connect')

0 commit comments

Comments
 (0)