File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11require 'aws-sdk'
2- require 'yaml'
32require 'json'
3+ require 'yaml'
4+ require 'rainbow'
45
5- VERSION = '0.0.11 '
6+ VERSION = '0.1.0 '
67CONFIG_DIR = "#{ ENV [ 'HOME' ] } /.restacker"
78CONFIG_FILE = "#{ CONFIG_DIR } /restacker.yml"
89SAMPLE_FILE = "#{ __dir__ } /../restacker-sample.yml"
910
1011# needed here (after config_dir and defaults_file)
1112require_relative 'auth'
1213
13- DEFAULT_PLANE = :ksp
14-
1514CREATE_COMPLETE = 'CREATE_COMPLETE'
1615CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS'
1716DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS'
1817DELETE_COMPLETE = 'DELETE_COMPLETE'
1918
2019class BaseStacker
2120 def initialize ( options )
22- @plane = options [ :location ] ? options [ :location ] . to_sym : DEFAULT_PLANE
23- config = RestackerConfig . load_config ( @plane )
21+ location = RestackerConfig . get_plane ( options )
22+ config = RestackerConfig . load_config ( location )
23+
2424 # use default region if not passed in from cli
2525 config [ :region ] = options [ :region ] if options [ :region ]
2626 options [ :region ] = config [ :region ] unless options [ :region ]
27- @cf , @creds = Auth . login ( options , config , @plane )
27+
28+ @cf , @creds = Auth . login ( options , config , location )
2829 @options = options
2930 end
3031end
You can’t perform that action at this time.
0 commit comments