From d3afb2af6d65f33d5091b01590d2cbd9ebf98c6b Mon Sep 17 00:00:00 2001 From: Musee Ullah Date: Sat, 3 Mar 2018 19:20:41 +0900 Subject: [PATCH] Update subscription removal patches for PVE 4.x/5.x, fixes #24 --- ...=> 00_remove_checked_command_jessie.patch} | 16 ++--- files/00_remove_checked_command_stretch.patch | 70 +++++++++++++++++++ tasks/main.yml | 9 ++- 3 files changed, 84 insertions(+), 11 deletions(-) rename files/{00_remove_checked_command.patch => 00_remove_checked_command_jessie.patch} (81%) create mode 100644 files/00_remove_checked_command_stretch.patch diff --git a/files/00_remove_checked_command.patch b/files/00_remove_checked_command_jessie.patch similarity index 81% rename from files/00_remove_checked_command.patch rename to files/00_remove_checked_command_jessie.patch index aa7a8273..b1be7285 100644 --- a/files/00_remove_checked_command.patch +++ b/files/00_remove_checked_command_jessie.patch @@ -1,6 +1,6 @@ ---- /usr/share/pve-manager/ext6/pvemanagerlib.js 2016-08-19 13:04:19.000000000 +0000 -+++ /usr/share/pve-manager/ext6/pvemanagerlib.js.new 2016-09-15 16:37:42.001671120 +0000 -@@ -509,37 +509,6 @@ +--- /usr/share/pve-manager/js/pvemanagerlib.js 2018-01-17 08:18:41.000000000 +0000 ++++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-03-03 09:59:41.521312774 +0000 +@@ -788,37 +788,6 @@ } }, @@ -36,9 +36,9 @@ - }, - task_desc_table: { + diskinit: [ 'Disk', gettext('Initialize Disk with GPT') ], vncproxy: [ 'VM/CT', gettext('Console') ], - spiceproxy: [ 'VM/CT', gettext('Console') + ' (Spice)' ], -@@ -15300,7 +15269,7 @@ +@@ -17078,7 +17047,7 @@ var version_btn = new Ext.Button({ text: gettext('Package versions'), handler: function(){ @@ -47,7 +47,7 @@ } }); -@@ -16556,7 +16525,7 @@ +@@ -18340,7 +18309,7 @@ { text: gettext('System Report'), handler: function() { @@ -56,7 +56,7 @@ } } ], -@@ -16645,7 +16614,7 @@ +@@ -18431,7 +18400,7 @@ var update_btn = new Ext.Button({ text: gettext('Refresh'), handler: function(){ @@ -65,7 +65,7 @@ } }); -@@ -31771,7 +31740,6 @@ +@@ -35093,7 +35062,6 @@ handler: function(data) { me.login = null; me.updateLoginData(data); diff --git a/files/00_remove_checked_command_stretch.patch b/files/00_remove_checked_command_stretch.patch new file mode 100644 index 00000000..af39a58d --- /dev/null +++ b/files/00_remove_checked_command_stretch.patch @@ -0,0 +1,70 @@ +diff -ur /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js +--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-02-16 12:06:39.000000000 +0000 ++++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-03-03 05:43:35.083364592 +0000 +@@ -342,37 +342,6 @@ + Ext.Ajax.requestopts); + }, + +- checked_command: function(orig_cmd) { +- Proxmox.Utils.API2Request({ +- url: '/nodes/localhost/subscription', +- method: 'GET', +- //waitMsgTarget: me, +- failure: function(response, opts) { +- Ext.Msg.alert(gettext('Error'), response.htmlStatus); +- }, +- success: function(response, opts) { +- var data = response.result.data; +- +- if (data.status !== 'Active') { +- Ext.Msg.show({ +- title: gettext('No valid subscription'), +- icon: Ext.Msg.WARNING, +- msg: Proxmox.Utils.getNoSubKeyHtml(data.url), +- buttons: Ext.Msg.OK, +- callback: function(btn) { +- if (btn !== 'ok') { +- return; +- } +- orig_cmd(); +- } +- }); +- } else { +- orig_cmd(); +- } +- } +- }); +- }, +- + assemble_field_data: function(values, data) { + if (Ext.isObject(data)) { + Ext.Object.each(data, function(name, val) { +diff -ur /usr/share/pve-manager/js/pvemanagerlib.js /usr/share/pve-manager/js/pvemanagerlib.js +--- /usr/share/pve-manager/js/pvemanagerlib.js 2018-02-16 14:07:52.000000000 +0000 ++++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-03-03 05:48:35.567396692 +0000 +@@ -13441,7 +13441,7 @@ + var version_btn = new Ext.Button({ + text: gettext('Package versions'), + handler: function(){ +- Proxmox.Utils.checked_command(function() { me.showVersions(); }); ++ me.showVersions(); + } + }); + +@@ -13691,7 +13691,7 @@ + { + text: gettext('System Report'), + handler: function() { +- Proxmox.Utils.checked_command(function (){ me.showReport(); }); ++ me.showReport(); + } + } + ], +@@ -30605,7 +30605,6 @@ + handler: function(data) { + me.login = null; + me.updateLoginData(data); +- Proxmox.Utils.checked_command(function() {}); // display subscription status + } + }); + } diff --git a/tasks/main.yml b/tasks/main.yml index ff78e18e..4682d20d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -89,13 +89,16 @@ - name: Remove subscription check wrapper function in web UI patch: - src: 00_remove_checked_command.patch - dest: /usr/share/pve-manager/js/pvemanagerlib.js + src: "00_remove_checked_command_{{ ansible_distribution_release }}.patch" + basedir: / + strip: 1 backup: yes when: - - "'pve-no-subscription' in pve_repository_line" - pve_remove_subscription_warning + when: + - "'pve-no-subscription' in pve_repository_line" + - include: kernel_updates.yml - include: ipmi_watchdog.yml