master daemon: give same name for downloaded package, thus the size will not explode 07/5307/1
authorYaroslav Brustinov <[email protected]>
Wed, 14 Dec 2016 17:47:09 +0000 (19:47 +0200)
committerYaroslav Brustinov <[email protected]>
Wed, 14 Dec 2016 17:47:09 +0000 (19:47 +0200)
Change-Id: Iffc4fe698b8a9d27656b7211fd2b969e735ef596
Signed-off-by: Yaroslav Brustinov <[email protected]>
scripts/master_daemon.py

index e4a2fd1..c3c9c2d 100755 (executable)
@@ -33,12 +33,11 @@ def get_trex_path():
 def update_trex(package_path = 'http://trex-tgn.cisco.com/trex/release/latest'):
     if not args.allow_update:
         raise Exception('Updating server not allowed')
+    file_name = 'trex_package.tar.gz'
     # getting new package
     if package_path.startswith('http'):
-        file_name = package_path.split('/')[-1]
         ret_code, stdout, stderr = run_command('wget %s -O %s' % (package_path, os.path.join(tmp_dir, file_name)), timeout = 600)
     else:
-        file_name = os.path.basename(package_path)
         ret_code, stdout, stderr = run_command('rsync -Lc %s %s' % (package_path, os.path.join(tmp_dir, file_name)), timeout = 300)
     if ret_code:
         raise Exception('Could not get requested package. Result: %s' % [ret_code, stdout, stderr])