summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fapi.conf.sample7
-rwxr-xr-xsrc/fapi9
2 files changed, 8 insertions, 8 deletions
diff --git a/fapi.conf.sample b/fapi.conf.sample
index 57216ea..b1085da 100644
--- a/fapi.conf.sample
+++ b/fapi.conf.sample
@@ -2,6 +2,9 @@
[fapi]
username: paul
password64: SECRET
-# Will try every box and will use the first one which works
-hostnames: bigip.example.com,bigip2.example.com
+# The qa loadbalancers (if specified -e qa)
+loadbalancers_qa: qa-01.example.com,qa-02.example.com
+# The qa loadbalancers (if specified -e live)
+loadbalancers_live: be-01.example.com,qa-be-02.example.com,qa-be-03.lb.server.la
+# You can specify your own/more envs too...
partition: Common
diff --git a/src/fapi b/src/fapi
index 3b02caf..9a4dd9f 100755
--- a/src/fapi
+++ b/src/fapi
@@ -88,12 +88,8 @@ class Fapi(object):
password = getpass.getpass(prompt)
self.info('Login to BigIP API with user %s' % username)
- if a.e != None:
- loadbalancers = c.get('fapi', 'loadbalancers_' + a.e)
- else:
- loadbalancers = c.get('fapi', 'loadbalancers')
-
# Try a comma separated lists of F5 boxes, use the first one
+ loadbalancers = c.get('fapi', 'loadbalancers_' + a.e)
err = None
for loadbalancer in loadbalancers.split(','):
try:
@@ -442,7 +438,8 @@ if __name__ == '__main__':
''' The main function, here we will have Popcorn for free! '''
parser = argparse.ArgumentParser(add_help=False)
- parser.add_argument('-e', action='store', help='Env to use, e.g. dev,qa,live')
+ parser.add_argument('-e', action='store', help='Env to use, e.g. dev,qa,live',
+ default='qa')
parser.add_argument('-h', action='store_true', help='Help')
parser.add_argument('-p', action='store', help='Overwrite partition from fapi.conf')
parser.add_argument('-v', action='store_true', help='Verbose')