Skip to content

Commit

Permalink
adding an option to override the default cache path for ec2.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jarv committed May 6, 2014
1 parent 56a67d3 commit 81f9da2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion playbooks/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ def read_settings(self):
config.get('ec2', 'route53_excluded_zones', '').split(','))

# Cache related
cache_path = config.get('ec2', 'cache_path')
if self.args.cache_path:
cache_path = self.args.cache_path
else:
cache_path = config.get('ec2', 'cache_path')
self.cache_path_cache = cache_path + "/ansible-ec2.cache"
self.cache_path_tags = cache_path + "/ansible-ec2.tags.cache"
self.cache_path_index = cache_path + "/ansible-ec2.index"
Expand All @@ -241,6 +244,10 @@ def parse_cli_args(self):
default_inifile = os.environ.get("ANSIBLE_EC2_INI", os.path.dirname(os.path.realpath(__file__))+'/ec2.ini')

parser.add_argument('--inifile', dest='inifile', help='Path to init script to use', default=default_inifile)
parser.add_argument(
'--cache-path',
help='Override the cache path set in ini file',
required=False)
self.args = parser.parse_args()


Expand Down

0 comments on commit 81f9da2

Please sign in to comment.