@@ -80,30 +80,7 @@ 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
-
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 ):
83
+ def generate_script (self ):
107
84
"""
108
85
Returns the installer script for the data resource.
109
86
@@ -128,7 +105,7 @@ def build_script(self):
128
105
for h in self ._hosts :
129
106
lines += h .copy_file_to (self ._server_filename , self .location ()).split ("\n " )
130
107
131
- return lines
108
+ return lines , []
132
109
133
110
def location (self ):
134
111
"""
@@ -206,9 +183,8 @@ class FileResource(Resource):
206
183
"""
207
184
208
185
def __init__ (self , name , hosts , source_file ):
209
- self ._source = source_file
210
-
211
186
super ().__init__ (name , hosts )
187
+ self ._server_filename = source_file
212
188
213
189
def md5 (self ):
214
190
"""
@@ -230,7 +206,7 @@ def data(self):
230
206
The resource data.
231
207
"""
232
208
233
- with open (self ._source , "rb" ) as f :
209
+ with open (self ._server_filename , "rb" ) as f :
234
210
return f .read ()
235
211
236
212
def save_data (self , target , filename ):
0 commit comments