Browse Source

Initial commit

tags/0.0.2
Radoslav Gerganov 2 years ago
commit
b2ddb14d5f
13 changed files with 555 additions and 0 deletions
  1. 2
    0
      .gitignore
  2. 4
    0
      .testr.conf
  3. 176
    0
      LICENSE
  4. 25
    0
      README.rst
  5. 0
    0
      novaproxy/__init__.py
  6. 125
    0
      novaproxy/authd.py
  7. 85
    0
      novaproxy/mksproxy.py
  8. 0
    0
      novaproxy/tests/__init__.py
  9. 93
    0
      novaproxy/tests/test_authd.py
  10. 2
    0
      requirements.txt
  11. 25
    0
      setup.py
  12. 4
    0
      test-requirements.txt
  13. 14
    0
      tox.ini

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+*.py[cod]
2
+

+ 4
- 0
.testr.conf View File

@@ -0,0 +1,4 @@
1
+[DEFAULT]
2
+test_command=python -m subunit.run discover -t ./ ./novaproxy/tests $LISTOPT $IDOPTION
3
+test_id_option=--load-list $IDFILE
4
+test_list_option=--list

+ 176
- 0
LICENSE View File

@@ -0,0 +1,176 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+

+ 25
- 0
README.rst View File

@@ -0,0 +1,25 @@
1
+nova-mksproxy
2
+=============
3
+
4
+This is Nova console proxy for instances running on VMware.
5
+It requires Nova to support microversion 2.31 to work.
6
+
7
+Usage
8
+-----
9
+1. Start the proxy with OpenStack admin credentials::
10
+
11
+    $ source openrc admin admin
12
+    $ nova-mksproxy --web /opt/share/noVNC
13
+
14
+   by default it binds to ``0.0.0.0:6090``
15
+
16
+2. Configure Nova to enable MKS consoles::
17
+
18
+    [mks]
19
+    enabled = True
20
+    mksproxy_base_url = http://<host>:<port>/vnc_auto.html
21
+
22
+3. Use nova CLI to get a console URL::
23
+
24
+    $ nova get-mks-console cirros
25
+

+ 0
- 0
novaproxy/__init__.py View File


+ 125
- 0
novaproxy/authd.py View File

@@ -0,0 +1,125 @@
1
+# Copyright (c) 2016 VMware Inc.
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+import base64
17
+import Cookie
18
+import hashlib
19
+import json
20
+import os
21
+import socket
22
+import ssl
23
+import urlparse
24
+
25
+import websockify
26
+
27
+
28
+VMAD_OK = 200
29
+VMAD_WELCOME = 220
30
+VMAD_LOGINOK = 230
31
+VMAD_NEEDPASSWD = 331
32
+VMAD_USER_CMD = "USER"
33
+VMAD_PASS_CMD = "PASS"
34
+VMAD_THUMB_CMD = "THUMBPRINT"
35
+VMAD_CONNECT_CMD = "CONNECT"
36
+
37
+
38
+def expect(sock, code):
39
+    line = sock.recv(1024)
40
+    recv_code, msg = line.split()[0:2]
41
+    recv_code = int(recv_code)
42
+    if code != recv_code:
43
+        raise Exception('Expected %d but received %d' % (code, recv_code))
44
+    return msg
45
+
46
+
47
+def handshake(host, port, ticket, cfg_file, thumbprint):
48
+    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
49
+    sock.connect((host, port))
50
+    expect(sock, VMAD_WELCOME)
51
+    sock = ssl.wrap_socket(sock)
52
+    sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
53
+    cert = sock.getpeercert(binary_form=True)
54
+    h = hashlib.sha1()
55
+    h.update(cert)
56
+    if thumbprint != h.hexdigest():
57
+        raise Exception("Server thumbprint doesn't match")
58
+    sock.write("%s %s\r\n" % (VMAD_USER_CMD, ticket))
59
+    expect(sock, VMAD_NEEDPASSWD)
60
+    sock.write("%s %s\r\n" % (VMAD_PASS_CMD, ticket))
61
+    expect(sock, VMAD_LOGINOK)
62
+    rand = os.urandom(12)
63
+    rand = base64.b64encode(rand)
64
+    sock.write("%s %s\r\n" % (VMAD_THUMB_CMD, rand))
65
+    thumbprint2 = expect(sock, VMAD_OK)
66
+    thumbprint2 = thumbprint2.replace(':', '').lower()
67
+    sock.write("%s %s mks\r\n" % (VMAD_CONNECT_CMD, cfg_file))
68
+    expect(sock, VMAD_OK)
69
+    sock2 = ssl.wrap_socket(sock)
70
+    cert2 = sock2.getpeercert(binary_form=True)
71
+    h = hashlib.sha1()
72
+    h.update(cert2)
73
+    if thumbprint2 != h.hexdigest():
74
+        raise Exception("Second thumbprint doesn't match")
75
+    sock2.write(rand)
76
+    return sock2
77
+
78
+
79
+class AuthdRequestHandler(websockify.ProxyRequestHandler):
80
+
81
+    @classmethod
82
+    def set_nova_client(cls, nova_client):
83
+        cls._nova_client = nova_client
84
+
85
+    def new_websocket_client(self):
86
+        # The nova expected behavior is to have token
87
+        # passed to the method GET of the request
88
+        parse = urlparse.urlparse(self.path)
89
+        query = parse.query
90
+        token = urlparse.parse_qs(query).get("token", [""]).pop()
91
+        if not token:
92
+            # NoVNC uses it's own convention that forward token
93
+            # from the request to a cookie header, we should check
94
+            # also for this behavior
95
+            hcookie = self.headers.getheader('cookie')
96
+            if hcookie:
97
+                cookie = Cookie.SimpleCookie()
98
+                cookie.load(hcookie)
99
+                if 'token' in cookie:
100
+                    token = cookie['token'].value
101
+
102
+        resp, body = self._nova_client.client.get(
103
+            '/os-console-auth-tokens/%s' % token)
104
+        # TODO check response
105
+        connect_info = body['console']
106
+        host = connect_info['host']
107
+        port = connect_info['port']
108
+        internal_access_path = connect_info['internal_access_path']
109
+        mks_auth = json.loads(internal_access_path)
110
+        ticket = mks_auth['ticket']
111
+        cfg_file = mks_auth['cfgFile']
112
+        thumbprint = mks_auth['thumbprint']
113
+
114
+        tsock = handshake(host, port, ticket, cfg_file, thumbprint)
115
+
116
+        # Start proxying
117
+        try:
118
+            self.do_proxy(tsock)
119
+        except Exception:
120
+            if tsock:
121
+                tsock.shutdown(socket.SHUT_RDWR)
122
+                tsock.close()
123
+                self.vmsg("%(host)s:%(port)s: Target closed" %
124
+                          {'host': host, 'port': port})
125
+            raise

+ 85
- 0
novaproxy/mksproxy.py View File

@@ -0,0 +1,85 @@
1
+# Copyright (c) 2016 VMware Inc.
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+import os
16
+import sys
17
+
18
+import argparse
19
+import authd
20
+from novaclient import client
21
+import websockify
22
+import logging
23
+
24
+
25
+def main():
26
+    parser = argparse.ArgumentParser()
27
+    parser.add_argument("--host", help="MKS proxy host (default '0.0.0.0')",
28
+                        default="0.0.0.0")
29
+    parser.add_argument("--port", help="MKS proxy port (default 6090)",
30
+                        type=int, default=6090)
31
+    parser.add_argument("--web", help="web location", required=True)
32
+    parser.add_argument("--verbose", help="verbose logging",
33
+                        action="store_true", default=False)
34
+    parser.add_argument("--username",
35
+                        help="OpenStack username (default $OS_USERNAME)",
36
+                        default=os.environ.get("OS_USERNAME"))
37
+    parser.add_argument("--password",
38
+                        help="OpenStack password (default $OS_PASSWORD)",
39
+                        default=os.environ.get("OS_PASSWORD"))
40
+    parser.add_argument("--project",
41
+                        help="OpenStack project (default $OS_PROJECT_NAME or "
42
+                             "$OS_TENANT_NAME)",
43
+                        default=os.environ.get("OS_PROJECT_NAME",
44
+                                   os.environ.get("OS_TENANT_NAME")))
45
+    parser.add_argument("--auth-url",
46
+                        help="OpenStack auth url (default $OS_AUTH_URL)",
47
+                        default=os.environ.get("OS_AUTH_URL"))
48
+    # TODO add log-file
49
+    # TODO add cert/key
50
+    args = parser.parse_args()
51
+
52
+    if not args.username:
53
+        sys.stderr.write('Missing OpenStack username\n')
54
+        sys.exit(1)
55
+    if not args.password:
56
+        sys.stderr.write('Missing OpenStack password\n')
57
+        sys.exit(1)
58
+    if not args.project:
59
+        sys.stderr.write('Missing OpenStack project\n')
60
+        sys.exit(1)
61
+    if not args.auth_url:
62
+        sys.stderr.write('Missing OpenStack auth URL\n')
63
+        sys.exit(1)
64
+
65
+    websockify.websocketproxy.logger_init()
66
+    logger = logging.getLogger(websockify.WebSocketProxy.log_prefix)
67
+    if args.verbose:
68
+        logger.setLevel(logging.DEBUG)
69
+
70
+    nova_client = client.Client("2.31", args.username, args.password,
71
+                                args.project, args.auth_url, logger=logger)
72
+
73
+    authd.AuthdRequestHandler.set_nova_client(nova_client)
74
+
75
+    websockify.WebSocketProxy(
76
+        listen_host=args.host,
77
+        listen_port=args.port,
78
+        verbose=args.verbose,
79
+        web=args.web,
80
+        file_only=True,
81
+        RequestHandlerClass=authd.AuthdRequestHandler
82
+    ).start_server()
83
+
84
+if __name__ == '__main__':
85
+    main()

+ 0
- 0
novaproxy/tests/__init__.py View File


+ 93
- 0
novaproxy/tests/test_authd.py View File

@@ -0,0 +1,93 @@
1
+# Copyright (c) 2016 VMware Inc.
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+import socket
16
+import ssl
17
+
18
+import mock
19
+import testtools
20
+
21
+from novaproxy import authd
22
+
23
+
24
+class AuthdRequestHandler(testtools.TestCase):
25
+
26
+    @mock.patch.object(socket, 'socket')
27
+    @mock.patch.object(ssl, 'wrap_socket')
28
+    def test_handshake(self, mock_wrap, mock_socket):
29
+        msgs = ['220 Welcome',
30
+                '331 Need password',
31
+                '230 Login OK',
32
+                '200 e6e4d191c0f9ebc6abc082d6e2eeeb5b7c90214d',
33
+                '200 OK']
34
+
35
+        def fake_recv(len):
36
+            return msgs.pop(0)
37
+
38
+        def fake_getpeercert(binary_form=True):
39
+            return 'fake-certificate'
40
+
41
+        sock = mock.MagicMock()
42
+        sock.recv = fake_recv
43
+        sock.getpeercert = fake_getpeercert
44
+        mock_wrap.return_value = sock
45
+        mock_socket.return_value = sock
46
+        authd.handshake('host', 902, 'ticket', 'cfgFile',
47
+                        'e6e4d191c0f9ebc6abc082d6e2eeeb5b7c90214d')
48
+
49
+    @mock.patch.object(socket, 'socket')
50
+    @mock.patch.object(ssl, 'wrap_socket')
51
+    def test_handshake_invalid_thumbprint(self, mock_wrap, mock_socket):
52
+        msgs = ['220 Welcome',
53
+                '331 Need password',
54
+                '230 Login OK',
55
+                '200 e6e4d191c0f9ebc6abc082d6e2eeeb5b7c90214d',
56
+                '200 OK']
57
+
58
+        def fake_recv(len):
59
+            return msgs.pop(0)
60
+
61
+        def fake_getpeercert(binary_form=True):
62
+            return 'fake-certificate'
63
+
64
+        sock = mock.MagicMock()
65
+        sock.recv = fake_recv
66
+        sock.getpeercert = fake_getpeercert
67
+        mock_wrap.return_value = sock
68
+        mock_socket.return_value = sock
69
+        self.assertRaises(Exception, authd.handshake, 'host', 902,
70
+                          'ticket', 'cfgFile', 'invalid-thumbprint')
71
+
72
+    @mock.patch.object(socket, 'socket')
73
+    @mock.patch.object(ssl, 'wrap_socket')
74
+    def test_handshake_invalid_2nd_thumbprint(self, mock_wrap, mock_socket):
75
+        msgs = ['220 Welcome',
76
+                '331 Need password',
77
+                '230 Login OK',
78
+                '200 invalid-2nd-thumbprint',
79
+                '200 OK']
80
+
81
+        def fake_recv(len):
82
+            return msgs.pop(0)
83
+
84
+        def fake_getpeercert(binary_form=True):
85
+            return 'fake-certificate'
86
+
87
+        sock = mock.MagicMock()
88
+        sock.recv = fake_recv
89
+        sock.getpeercert = fake_getpeercert
90
+        mock_wrap.return_value = sock
91
+        mock_socket.return_value = sock
92
+        self.assertRaises(Exception, authd.handshake, 'host', 902,
93
+              'ticket', 'cfg', 'e6e4d191c0f9ebc6abc082d6e2eeeb5b7c90214d')

+ 2
- 0
requirements.txt View File

@@ -0,0 +1,2 @@
1
+python-novaclient
2
+websockify

+ 25
- 0
setup.py View File

@@ -0,0 +1,25 @@
1
+from setuptools import setup
2
+
3
+with open('README.rst') as f:
4
+    readme = f.read()
5
+
6
+
7
+with open('LICENSE') as f:
8
+    license = f.read()
9
+
10
+
11
+setup(
12
+    name='nova-mksproxy',
13
+    version='0.0.1',
14
+    description='Nova console proxy for VMware instances',
15
+    long_description=readme,
16
+    author='VMware Inc.',
17
+    author_email='rgerganov@vmware.com',
18
+    url='https://github.com/rgerganov/nova-mksproxy',
19
+    license=license,
20
+    entry_points = {
21
+        'console_scripts': ['nova-mksproxy=novaproxy.mksproxy:main'],
22
+    },
23
+    packages=['novaproxy'],
24
+    install_requires=['websockify', 'python-novaclient']
25
+)

+ 4
- 0
test-requirements.txt View File

@@ -0,0 +1,4 @@
1
+testtools
2
+mock
3
+testrepository
4
+flake8

+ 14
- 0
tox.ini View File

@@ -0,0 +1,14 @@
1
+[tox]
2
+envlist = py27,pep8
3
+skipsdist = True
4
+
5
+[testenv]
6
+deps = -rrequirements.txt
7
+       -rtest-requirements.txt
8
+commands = python setup.py testr --slowest --testr-args='{posargs}'
9
+
10
+[testenv:pep8]
11
+commands = flake8
12
+
13
+[flake8]
14
+ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405

Loading…
Cancel
Save