[FIX]Attempt to fix badstatusline error on one host when backup

This commit is contained in:
Fabien BOURGEOIS 2022-06-13 07:47:10 +02:00
parent e784bb676d
commit d1e9458d45

View File

@ -22,15 +22,16 @@ def dump(odoo, args):
dumpf = odoo.db.dump(args.password, dbname, args.format)
else:
conn = httplib.HTTPConnection(args.host, args.port)
headers = {'User-Agent': ('Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) '
'Gecko/20100101 Firefox/24.0'),
'Accept': 'text/plain'}
if odoo.version != '8.0':
params = urllib.urlencode({'master_pwd': args.password,
'name': dbname,
'backup_format': args.format})
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"}
headers['Content-type'] = 'application/x-www-form-urlencoded'
conn.request('POST', '/web/database/backup', params, headers)
else:
headers = {"Accept": "text/plain"}
url = (u'/web/database/backup?backup_pwd=%s&backup_db=%s'
'&backup_format=%s&token=') % (args.password, dbname, args.format)
conn.request('GET', url, '', headers)