Permalink
Browse files

allowing the port to be overridden by an environment variable

  • Loading branch information...
1 parent 3e19bf5 commit 572868b88510f50204fcdb64e85ff215cca86eeb @buzztroll buzztroll committed Nov 18, 2011
@@ -61,6 +61,15 @@ def setUp(self):
host = 'localhost'
cumport = 8888
ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+ try:
+ cumport = int(os.environ['NIMBUS_TEST_S3_PORT'])
+ except:
+ pass
+
self.db = DB(pycb.config.authzdb)
self.friendly = os.environ['NIMBUS_TEST_USER']
View
@@ -38,6 +38,11 @@ class TestEC2Misc(unittest.TestCase):
def setUp(self):
host = 'localhost'
ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+
self.db = DB(pycb.config.authzdb)
self.friendly = os.environ['NIMBUS_TEST_USER']
self.can_user = User.get_user_by_friendly(self.db, self.friendly)
View
@@ -34,6 +34,16 @@ def setUp(self):
host = 'localhost'
cumport = 8888
ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+ try:
+ cumport = int(os.environ['NIMBUS_TEST_S3_PORT'])
+ except:
+ pass
+
+
self.db = DB(pycb.config.authzdb)
self.friendly = self.cb_random_bucketname(21)
self.can_user = User(self.db, friendly=self.friendly, create=True)
View
@@ -53,6 +53,15 @@ def setUp(self):
host = 'localhost'
cumport = 8888
ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+ try:
+ cumport = int(os.environ['NIMBUS_TEST_S3_PORT'])
+ except:
+ pass
+
self.db = DB(pycb.config.authzdb)
self.friendly = self.cb_random_bucketname(21)
self.can_user = User(self.db, friendly=self.friendly, create=True)
View
@@ -65,7 +65,13 @@ def main(argv=sys.argv[1:]):
sys.exit(1)
print "getting connection"
- ec2conn = EC2Connection(s3id, pw, host='locahost', port=8444, debug=2)
+ ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+
+ ec2conn = EC2Connection(s3id, pw, host='locahost', port=ec2port, debug=2)
ec2conn.host = 'localhost'
print "getting image"
image = ec2conn.get_image(imagename)
@@ -65,6 +65,15 @@ def setUp(self):
host = 'localhost'
cumport = 8888
ec2port = 8444
+ try:
+ ec2port = int(os.environ['NIMBUS_TEST_EC2_PORT'])
+ except:
+ pass
+ try:
+ cumport = int(os.environ['NIMBUS_TEST_S3_PORT'])
+ except:
+ pass
+
self.db = DB(pycb.config.authzdb)
self.friendly = os.environ['NIMBUS_TEST_USER']
self.can_user = User.get_user_by_friendly(self.db, self.friendly)

0 comments on commit 572868b

Please sign in to comment.