@@ -127,7 +127,7 @@ async def upload_extension_attribute(session, url, user, passwd, ext_attr, semap
127
127
with open (join (mypath , 'extension_attributes' , ext_attr , script_file [0 ]), 'r' ) as f :
128
128
data = f .read ()
129
129
async with semaphore :
130
- with async_timeout .timeout (10 ):
130
+ with async_timeout .timeout (args . timeout ):
131
131
template = await get_ea_template (session , url , user , passwd , ext_attr )
132
132
async with session .get (url + '/JSSResource/computerextensionattributes/name/' + template .find ('name' ).text ,
133
133
auth = auth , headers = headers ) as resp :
@@ -157,7 +157,7 @@ async def get_ea_template(session, url, user, passwd, ext_attr):
157
157
with open (join (mypath , 'extension_attributes' , ext_attr , xml_file [0 ]), 'r' ) as file :
158
158
template = ET .fromstring (file .read ())
159
159
except IndexError :
160
- with async_timeout .timeout (10 ):
160
+ with async_timeout .timeout (args . timeout ):
161
161
headers = {'Accept' : 'application/xml' ,'Content-Type' :'application/xml' }
162
162
async with session .get (url + '/JSSResource/computerextensionattributes/name/' + ext_attr ,
163
163
auth = auth , headers = headers ) as resp :
@@ -211,7 +211,7 @@ async def upload_script(session, url, user, passwd, script, semaphore):
211
211
with open (join (mypath , 'scripts' , script , script_file [0 ]), 'r' ) as f :
212
212
data = f .read ()
213
213
async with semaphore :
214
- with async_timeout .timeout (10 ):
214
+ with async_timeout .timeout (args . timeout ):
215
215
template = await get_script_template (session , url , user , passwd , script )
216
216
async with session .get (url + '/JSSResource/scripts/name/' + template .find ('name' ).text ,
217
217
auth = auth , headers = headers ) as resp :
@@ -235,7 +235,7 @@ async def get_script_template(session, url, user, passwd, script):
235
235
with open (join (mypath , 'scripts' , script , xml_file [0 ]), 'r' ) as file :
236
236
template = ET .fromstring (file .read ())
237
237
except IndexError :
238
- with async_timeout .timeout (10 ):
238
+ with async_timeout .timeout (args . timeout ):
239
239
headers = {'Accept' : 'application/xml' ,'Content-Type' :'application/xml' }
240
240
async with session .get (url + '/JSSResource/scripts/name/' + script ,
241
241
auth = auth , headers = headers ) as resp :
@@ -269,6 +269,7 @@ async def main(args):
269
269
parser .add_argument ('--username' )
270
270
parser .add_argument ('--password' )
271
271
parser .add_argument ('--limit' , type = int , default = 25 )
272
+ parser .add_argument ('--timeout' , type = int , default = 60 )
272
273
parser .add_argument ('--verbose' , action = 'store_true' )
273
274
parser .add_argument ('--do_not_verify_ssl' , action = 'store_false' )
274
275
parser .add_argument ('--update_all' , action = 'store_true' )
0 commit comments