[novnc] Patch out the old flags module in the nova-novncproxy script
Nikola Dipanov
ndipanov at fedoraproject.org
Tue Mar 19 09:14:26 UTC 2013
commit 81fe8914bc368b184aa3e87e25eec8ea62d929d3
Author: Nikola Dipanov <ndipanov at redhat.com>
Date: Mon Mar 18 16:20:18 2013 +0100
Patch out the old flags module in the nova-novncproxy script
Also removes a hard dep on the whole nova package
novnc-0.4-nova-flags-to-conf.patch | 85 ++++++++++++++++++++++++++++++++++++
novnc-0.4-nova-wsproxy.patch | 10 ++--
novnc.spec | 14 ++++--
3 files changed, 100 insertions(+), 9 deletions(-)
---
diff --git a/novnc-0.4-nova-flags-to-conf.patch b/novnc-0.4-nova-flags-to-conf.patch
new file mode 100644
index 0000000..46a8666
--- /dev/null
+++ b/novnc-0.4-nova-flags-to-conf.patch
@@ -0,0 +1,85 @@
+From b832b395d97326c1c4a606298669fae58678d801 Mon Sep 17 00:00:00 2001
+From: Terry Wilson <twilson at redhat.com>
+Date: Thu, 8 Nov 2012 17:49:12 -0500
+Subject: [PATCH] Mirror FLAGS->CONF change in Nova
+
+Nova recently removed parse_args from flags.py. This updates the
+nova proxy to properly use CONF instead of FLAGS.
+
+Also, currently CONF was attempted of being imported from nova config.py
+rather than openstack/common/cfg.py. this commit fixes that.
+---
+ utils/nova-novncproxy | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/utils/nova-novncproxy b/utils/nova-novncproxy
+index c1cc4d3..c3afe44 100755
+--- a/utils/nova-novncproxy
++++ b/utils/nova-novncproxy
+@@ -28,8 +28,8 @@ import sys
+
+ import wsproxy
+
++from nova import config
+ from nova import context
+-from nova import flags
+ from nova import utils
+ from nova.openstack.common import cfg
+ from nova.openstack.common import rpc
+@@ -64,13 +64,13 @@ opts = [
+ default=6080,
+ help='Port on which to listen for incoming requests'),
+ ]
+-FLAGS = flags.FLAGS
+-FLAGS.register_cli_opts(opts)
++CONF = cfg.CONF
++CONF.register_cli_opts(opts)
+
+ # As of nova commit 0b11668e64450039dc071a4a123abd02206f865f we must
+ # manually register the rpc library
+ if hasattr(rpc, 'register_opts'):
+- rpc.register_opts(FLAGS)
++ rpc.register_opts(CONF)
+
+
+ class NovaWebSocketProxy(wsproxy.WebSocketProxy):
+@@ -128,23 +128,23 @@ class NovaWebSocketProxy(wsproxy.WebSocketProxy):
+
+
+ if __name__ == '__main__':
+- if FLAGS.ssl_only and not os.path.exists(FLAGS.cert):
+- parser.error("SSL only and %s not found" % FLAGS.cert)
++ if CONF.ssl_only and not os.path.exists(CONF.cert):
++ parser.error("SSL only and %s not found" % CONF.cert)
+
+ # Setup flags
+- flags.parse_args(sys.argv)
++ config.parse_args(sys.argv)
+
+ # Create and start the NovaWebSockets proxy
+- server = NovaWebSocketProxy(listen_host=FLAGS.novncproxy_host,
+- listen_port=FLAGS.novncproxy_port,
+- source_is_ipv6=FLAGS.source_is_ipv6,
+- verbose=FLAGS.verbose,
+- cert=FLAGS.cert,
+- key=FLAGS.key,
+- ssl_only=FLAGS.ssl_only,
+- daemon=FLAGS.daemon,
+- record=FLAGS.record,
+- web=FLAGS.web,
++ server = NovaWebSocketProxy(listen_host=CONF.novncproxy_host,
++ listen_port=CONF.novncproxy_port,
++ source_is_ipv6=CONF.source_is_ipv6,
++ verbose=CONF.verbose,
++ cert=CONF.cert,
++ key=CONF.key,
++ ssl_only=CONF.ssl_only,
++ daemon=CONF.daemon,
++ record=CONF.record,
++ web=CONF.web,
+ target_host='ignore',
+ target_port='ignore',
+ wrap_mode='exit',
+--
+1.7.9.5
+
diff --git a/novnc-0.4-nova-wsproxy.patch b/novnc-0.4-nova-wsproxy.patch
index 4d00ece..ff11dde 100644
--- a/novnc-0.4-nova-wsproxy.patch
+++ b/novnc-0.4-nova-wsproxy.patch
@@ -1,7 +1,7 @@
-From dec9511e0008c28462d7a98df0629479ab0c103d Mon Sep 17 00:00:00 2001
+From 8cd8515195fb56e962c4740a82847137419e2da8 Mon Sep 17 00:00:00 2001
From: Adam Young <ayoung at redhat.com>
Date: Thu, 7 Jun 2012 10:10:41 -0400
-Subject: [PATCH] IN the final RPM, there is no wsproxy, but rather just
+Subject: [PATCH] IN the final RPM, there is no wsproxy, but rather just
websockify.
---
@@ -9,7 +9,7 @@ Subject: [PATCH] IN the final RPM, there is no wsproxy, but rather just
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/nova-novncproxy b/utils/nova-novncproxy
-index a920492..a172212 100755
+index c3afe44..38a56d4 100755
--- a/utils/nova-novncproxy
+++ b/utils/nova-novncproxy
@@ -26,7 +26,7 @@ import Cookie
@@ -19,8 +19,8 @@ index a920492..a172212 100755
-import wsproxy
+import websockify as wsproxy
+ from nova import config
from nova import context
- from nova import flags
--
-1.7.10.2
+1.7.9.5
diff --git a/novnc.spec b/novnc.spec
index bc6671f..04b3488 100644
--- a/novnc.spec
+++ b/novnc.spec
@@ -15,7 +15,7 @@
Name: novnc
Version: 0.4
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: VNC client using HTML5 (Web Sockets, Canvas) with encryption support
Requires: python-websockify
@@ -27,9 +27,10 @@ Source2: openstack-nova-novncproxy.init
Source3: openstack-nova-novncproxy.sysconfig
-Patch0: novnc-0.4-nova-wsproxy.patch
Patch1: novnc-0.4-manpage.patch
Patch2: novnc-0.4-call-websockify.patch
+Patch3: novnc-0.4-nova-flags-to-conf.patch
+Patch100: novnc-0.4-nova-wsproxy.patch
BuildArch: noarch
BuildRequires: python2-devel
@@ -40,7 +41,7 @@ Websocket implementation of VNC client
%package -n openstack-nova-novncproxy
Summary: Proxy server for noVNC traffic over Websockets
Requires: novnc
-Requires: openstack-nova
+Requires: openstack-nova-common
Requires: python-websockify
%if %{with_systemd}
@@ -59,9 +60,10 @@ OpenStack Nova noVNC server that proxies VNC traffic over Websockets
%prep
%setup -q
-%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch100 -p1
%build
@@ -137,6 +139,10 @@ fi
%endif
%changelog
+* Mon Mar 18 2013 Nikola Đipanov <ndipanov at redhat.com> - 0.4-5
+- Change FLAGS to the new CONF module in nova-novncproxy
+- Drop the hard dwp on whole nova package and require only nova-common
+
* Thu Feb 28 2013 Pádraig Brady <P at draigBrady.com> - 0.4-4
- Support /etc/sysconfig/openstack-nova-novncproxy #916479
More information about the scm-commits
mailing list