@@ -80,30 +80,8 @@ def get_resource(self, filename):
80
80
81
81
return []
82
82
83
- def install_file_stub (self , target ):
84
- """
85
- Installs any data associated with the resource object that is going to be deployed from the **ecFlow** server.
86
-
87
- Parameters:
88
- target(Deployment): The target deployment where the resource data should be installed.
89
- """
90
83
91
- """
92
- n.b. If a resource does not need to save data at deployment time, it should not do so (e.g. WebResource)
93
- """
94
- # Install path is for the suite, so we don't need to include the suite name
95
- assert self .fullname .count ("/" ) > 1
96
- subpath = self .fullname [self .fullname .find ("/" , 1 ) + 1 :]
97
-
98
- self ._server_filename = os .path .join (
99
- target .files_install_path (), subpath , self .name
100
- )
101
-
102
- super ().install_file_stub (target )
103
-
104
- self .save_data (target , self ._server_filename )
105
-
106
- def build_script (self ):
84
+ def generate_script (self ):
107
85
"""
108
86
Returns the installer script for the data resource.
109
87
@@ -128,7 +106,7 @@ def build_script(self):
128
106
for h in self ._hosts :
129
107
lines += h .copy_file_to (self ._server_filename , self .location ()).split ("\n " )
130
108
131
- return lines
109
+ return lines , []
132
110
133
111
def location (self ):
134
112
"""
@@ -141,6 +119,7 @@ def location(self):
141
119
return os .path .join (self ._resource_directory , self .name )
142
120
143
121
122
+
144
123
class DataResource (Resource ):
145
124
"""
146
125
Provides a data resource to be deployed at suite generation time.
@@ -206,9 +185,8 @@ class FileResource(Resource):
206
185
"""
207
186
208
187
def __init__ (self , name , hosts , source_file ):
209
- self ._source = source_file
210
-
211
188
super ().__init__ (name , hosts )
189
+ self ._server_filename = source_file
212
190
213
191
def md5 (self ):
214
192
"""
@@ -230,7 +208,7 @@ def data(self):
230
208
The resource data.
231
209
"""
232
210
233
- with open (self ._source , "rb" ) as f :
211
+ with open (self ._server_filename , "rb" ) as f :
234
212
return f .read ()
235
213
236
214
def save_data (self , target , filename ):
0 commit comments