Advertisement
Guest User

nova-novncproxy

a guest
Jun 3rd, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.66 KB | None | 0 0
  1. --- /usr/bin/nova-novncproxy    2013-06-03 16:47:02.606589274 -0400
  2. +++ nova-novncproxy 2013-06-03 16:46:48.614592760 -0400
  3. @@ -26,12 +26,13 @@
  4.  import socket
  5.  import sys
  6.  
  7. +from oslo.config import cfg
  8. +
  9.  from novnc import wsproxy
  10.  
  11.  from nova import context
  12. -from nova import flags
  13. +from nova import config
  14.  from nova import utils
  15. -from nova.openstack.common import cfg
  16.  from nova.openstack.common import rpc
  17.  
  18.  
  19. @@ -64,13 +65,13 @@
  20.                 default=6080,
  21.                 help='Port on which to listen for incoming requests'),
  22.      ]
  23. -FLAGS = flags.FLAGS
  24. -FLAGS.register_cli_opts(opts)
  25. +CONF = cfg.CONF
  26. +CONF.register_cli_opts(opts)
  27.  
  28.  # As of nova commit 0b11668e64450039dc071a4a123abd02206f865f we must
  29.  # manually register the rpc library
  30.  if hasattr(rpc, 'register_opts'):
  31. -    rpc.register_opts(FLAGS)
  32. +    rpc.register_opts(CONF)
  33.  
  34.  
  35.  class NovaWebSocketProxy(wsproxy.WebSocketProxy):
  36. @@ -128,23 +129,23 @@
  37.  
  38.  
  39.  if __name__ == '__main__':
  40. -    if FLAGS.ssl_only and not os.path.exists(FLAGS.cert):
  41. -        parser.error("SSL only and %s not found" % FLAGS.cert)
  42. +    if CONF.ssl_only and not os.path.exists(CONF.cert):
  43. +        parser.error("SSL only and %s not found" % CONF.cert)
  44.  
  45. -    # Setup flags
  46. -    flags.parse_args(sys.argv)
  47. +    # Setup cfg
  48. +    config.parse_args(sys.argv)
  49.  
  50.      # Create and start the NovaWebSockets proxy
  51. -    server = NovaWebSocketProxy(listen_host=FLAGS.novncproxy_host,
  52. -                                listen_port=FLAGS.novncproxy_port,
  53. -                                source_is_ipv6=FLAGS.source_is_ipv6,
  54. -                                verbose=FLAGS.verbose,
  55. -                                cert=FLAGS.cert,
  56. -                                key=FLAGS.key,
  57. -                                ssl_only=FLAGS.ssl_only,
  58. -                                daemon=FLAGS.daemon,
  59. -                                record=FLAGS.record,
  60. -                                web=FLAGS.web,
  61. +    server = NovaWebSocketProxy(listen_host=CONF.novncproxy_host,
  62. +                                listen_port=CONF.novncproxy_port,
  63. +                                source_is_ipv6=CONF.source_is_ipv6,
  64. +                                verbose=CONF.verbose,
  65. +                                cert=CONF.cert,
  66. +                                key=CONF.key,
  67. +                                ssl_only=CONF.ssl_only,
  68. +                                daemon=CONF.daemon,
  69. +                                record=CONF.record,
  70. +                                web=CONF.web,
  71.                                  target_host='ignore',
  72.                                  target_port='ignore',
  73.                                  wrap_mode='exit',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement