18
18
19
19
import fnmatch
20
20
import os
21
- import urllib
22
21
23
22
import prestoadmin
24
23
@@ -102,27 +101,10 @@ def copy_presto_rpm_to_master(self, cluster=None):
102
101
cluster = self .testcase .cluster
103
102
104
103
rpm_path = os .path .join (self .rpm_dir , self .rpm_name )
105
- try :
106
- cluster .copy_to_host (rpm_path , cluster .master )
107
- self ._check_if_corrupted_rpm (self .rpm_name , cluster )
108
- except OSError :
109
- print 'Downloading RPM again'
110
- # try to download the RPM again if it's corrupt (but only once)
111
- StandalonePrestoInstaller ._download_rpm ()
112
- cluster .copy_to_host (rpm_path , cluster .master )
113
- self ._check_if_corrupted_rpm (self .rpm_name , cluster )
104
+ cluster .copy_to_host (rpm_path , cluster .master )
105
+ self ._check_if_corrupted_rpm (self .rpm_name , cluster )
114
106
return self .rpm_name
115
107
116
- @staticmethod
117
- def _download_rpm ():
118
- rpm_filename = 'presto-server-rpm.rpm'
119
- rpm_path = os .path .join (prestoadmin .main_dir ,
120
- rpm_filename )
121
- urllib .urlretrieve (
122
- 'http://search.maven.org/remotecontent?filepath=com/facebook/presto/'
123
- 'presto-server-rpm/0.148/presto-server-rpm-0.148.rpm' , rpm_path )
124
- return rpm_filename
125
-
126
108
@staticmethod
127
109
def _detect_presto_rpm ():
128
110
"""
@@ -136,11 +118,7 @@ def _detect_presto_rpm():
136
118
# are multiple RPMs, the last one is probably the latest
137
119
rpm_name = sorted (rpm_names )[- 1 ]
138
120
else :
139
- try :
140
- rpm_name = StandalonePrestoInstaller ._download_rpm ()
141
- except :
142
- # retry once
143
- rpm_name = StandalonePrestoInstaller ._download_rpm ()
121
+ raise OSError (1 , 'Presto RPM not detected.' )
144
122
145
123
return prestoadmin .main_dir , rpm_name
146
124
0 commit comments