Skip to content

Commit fc9e422

Browse files
committed
Wait for presto user after rpm installation
Task: SWARM-2123 Pull request: #145
1 parent b85a15f commit fc9e422

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

.pypirc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ index-servers = pypi_internal
44
[pypi_internal]
55
repository: http://bdch-ftp.td.teradata.com:8082
66
username: admin
7-
password: hadoopdb
7+
password: hadoopdb

prestoadmin/server.py

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from fabric.operations import run, os
2727
from fabric.tasks import execute
2828
from fabric.utils import warn, error
29+
from retrying import retry
2930

3031
from prestoadmin import configure_cmds
3132
from prestoadmin import connector
@@ -115,6 +116,7 @@ def install(local_path):
115116
def deploy_install_configure(local_path):
116117
package.deploy_install(local_path)
117118
update_configs()
119+
wait_for_presto_user()
118120

119121

120122
def add_tpch_connector():
@@ -134,6 +136,14 @@ def update_configs():
134136
_LOGGER.info('No connector directory found, not adding connectors.')
135137

136138

139+
@retry(stop_max_delay=30000, wait_fixed=2000)
140+
def wait_for_presto_user():
141+
ret = sudo('getent passwd presto')
142+
if not ret.succeeded:
143+
raise Exception('Presto package was not installed successufully. '
144+
'Presto user was not created.')
145+
146+
137147
@task
138148
@requires_config(StandaloneConfig)
139149
def uninstall():

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ PyYAML==3.11
1616
overrides==0.5
1717
setuptools==20.1.1
1818
pip==7.1.2
19+
retrying==1.3.3

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
'setuptools==20.1.1',
4444
'wheel==0.23.0',
4545
'flake8==2.5.4',
46-
'tox==1.9.2'
46+
'tox==1.9.2',
47+
'retrying==1.3.3'
4748
]
4849

4950
test_requirements = [

0 commit comments

Comments
 (0)