|
|
|
|
@ -66,6 +66,10 @@ class GetVersion(object): |
|
|
|
|
with db_conn.cursor(cursor=DictCursor) as db_cursor: |
|
|
|
|
db_cursor.execute(sql_str) |
|
|
|
|
res = db_cursor.fetchone() |
|
|
|
|
print('server_version', res['server_version']) |
|
|
|
|
ver_num = res['server_version'].replace('Cloud_', '') |
|
|
|
|
ver_id = int(ver_num[7:11]) if ver_num.startswith('2') else int(ver_num[6:10]) |
|
|
|
|
print('ver_id', ver_id) |
|
|
|
|
update_data = { |
|
|
|
|
'name': res['cinema_name'], |
|
|
|
|
'zz_num': res['cinema_num'], |
|
|
|
|
@ -76,12 +80,13 @@ class GetVersion(object): |
|
|
|
|
'update_time': timezone.now(), |
|
|
|
|
'is_cloud': '云版本' if res.get('dx_sys_version', '--') == 'CLOUD' else '--', |
|
|
|
|
'remote_label': res.get('cinema_label', '--') if res.get('cinema_label', '--') != '' else '--', |
|
|
|
|
'ver_id': int(res['server_version'][13:17]) if res['server_version'].startswith('Cloud_') else int(res['server_version'][7:11]), |
|
|
|
|
'ver_id': ver_id, |
|
|
|
|
'is_online': True |
|
|
|
|
} |
|
|
|
|
print(ip, update_data, db_config) |
|
|
|
|
cinema_obj = Cinema.objects.filter(ip=ip).update(**update_data) |
|
|
|
|
except Exception as e: |
|
|
|
|
print('-----get_cinema_ver-----') |
|
|
|
|
print(e) |
|
|
|
|
cinema_obj = Cinema.objects.filter(ip=ip).update(is_online=False) |
|
|
|
|
finally: |
|
|
|
|
|