-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganizing project files and adding ability to remove creds with a …
…single command.
- Loading branch information
Aslan Brooke
committed
May 15, 2016
1 parent
f5c5840
commit cb43a85
Showing
15 changed files
with
127 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'thor' | ||
|
||
module ZAWS | ||
module Command | ||
class Config < Thor | ||
class_option :verbose, :type => :boolean, :desc => "Verbose outout", :aliases => :d, :default => false | ||
|
||
attr_accessor :config | ||
attr_accessor :out | ||
attr_accessor :print_exit_code | ||
|
||
def initialize(*args) | ||
super | ||
shellout=ZAWS::Helper::Shell.new | ||
nessusapi = ZAWS::Nessusapi.new(shellout) | ||
sumoapi = ZAWS::Sumoapi.new(shellout) | ||
newrelicapi = ZAWS::Newrelicapi.new(shellout) | ||
awscli = ZAWS::AWSCLI.new(shellout) | ||
@config = ZAWS::Controllers::Config.new(shellout, nessusapi,sumoapi,newrelicapi,awscli) | ||
@out = $stdout | ||
@print_exit_code = false | ||
end | ||
|
||
desc "remove_creds", "remove_creds" | ||
option :home, :type => :string, :default => ENV['HOME'], :desc => 'Home directory location for credentials file' | ||
def remove_creds | ||
@config.awscli.home=options[:home] | ||
@config.awscli.remove_creds() | ||
|
||
@config.nessusapi.home=options[:home] | ||
@config.nessusapi.remove_creds() | ||
|
||
@config.sumoapi.home=options[:home] | ||
@config.sumoapi.remove_creds() | ||
|
||
@config.newrelicapi.home=options[:home] | ||
@config.newrelicapi.remove_creds() | ||
end | ||
|
||
end | ||
end | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module ZAWS | ||
module Controllers | ||
class Config | ||
|
||
def initialize(shellout, nessusapi,sumoapi,newrelicapi,awscli) | ||
@shellout=shellout | ||
@_nessusapi= nessusapi ? nessusapi : ZAWS::Nessusapi.new(@shellout) | ||
@_sumoapi= sumoapi ? sumoapi : ZAWS::Sumoapi.new(@shellout) | ||
@_newrelicapi= newrelicapi ? newrelicapi : ZAWS::Newrelicapi.new(@shellout) | ||
@_awscli= awscli ? awscli : ZAWS::AWSCLI.new(@shellout) | ||
end | ||
|
||
def nessusapi | ||
return @_nessusapi | ||
end | ||
|
||
def sumoapi | ||
return @_sumoapi | ||
end | ||
|
||
def newrelicapi | ||
return @_newrelicapi | ||
end | ||
|
||
def awscli | ||
return @_awscli | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters