summaryrefslogtreecommitdiffstats
path: root/nova/auth
diff options
context:
space:
mode:
authorTodd Willey <todd@rubidine.com>2010-07-15 00:12:12 -0400
committerTodd Willey <todd@rubidine.com>2010-07-15 00:12:12 -0400
commit892ca58c0642db19e57a89d7a2ae5466971249cf (patch)
treeb7e5255b85776a75f29f756e48a8d69058499964 /nova/auth
parentb8306f37fc53e59b744f00637d0e74ebe8f6b0e6 (diff)
change default vpn ports and remove complex vpn ip iteration
Diffstat (limited to 'nova/auth')
-rw-r--r--nova/auth/users.py27
1 files changed, 11 insertions, 16 deletions
diff --git a/nova/auth/users.py b/nova/auth/users.py
index b1bc971c9..9272f48ea 100644
--- a/nova/auth/users.py
+++ b/nova/auth/users.py
@@ -102,9 +102,9 @@ flags.DEFINE_string('credential_cert_file', 'cert.pem',
flags.DEFINE_string('credential_rc_file', 'novarc',
'Filename of rc in credentials zip')
-flags.DEFINE_integer('vpn_start_port', 8000,
+flags.DEFINE_integer('vpn_start_port', 1000,
'Start port for the cloudpipe VPN servers')
-flags.DEFINE_integer('vpn_end_port', 9999,
+flags.DEFINE_integer('vpn_end_port', 2000,
'End port for the cloudpipe VPN servers')
flags.DEFINE_string('credential_cert_subject',
@@ -325,20 +325,15 @@ class Vpn(datastore.BasicModel):
@classmethod
def create(cls, project_id):
- # TODO (vish): get list of vpn ips from redis
- for ip in [FLAGS.vpn_ip]:
- try:
- port = cls.find_free_port_for_ip(ip)
- vpn = cls(project_id)
- # save ip for project
- vpn['project'] = project_id
- vpn['ip'] = ip
- vpn['port'] = port
- vpn.save()
- return vpn
- except NoMorePorts:
- pass
- raise NoMorePorts()
+ # TODO(vish): get list of vpn ips from redis
+ port = cls.find_free_port_for_ip(FLAGS.vpn_ip)
+ vpn = cls(project_id)
+ # save ip for project
+ vpn['project'] = project_id
+ vpn['ip'] = FLAGS.vpn_ip
+ vpn['port'] = port
+ vpn.save()
+ return vpn
@classmethod
def find_free_port_for_ip(cls, ip):