lib/kaname/cli.rb in kaname-0.8.2 vs lib/kaname/cli.rb in kaname-0.9.0
- old
+ new
@@ -18,18 +18,19 @@
Kaname::Adapter::ReadAndWrite.new.update_user_password(old_password, new_password)
end
option :dryrun, type: :boolean
+ option :filename, aliases: :f, type: :string, default: 'keystone.yml'
desc 'apply', 'Commands about configuration apply'
def apply
adapter = if options[:dryrun]
Kaname::Adapter::ReadOnly.new
else
Kaname::Adapter::ReadAndWrite.new
end
- if Kaname::Resource.yaml
+ if Kaname::Resource.yaml(options[:filename])
diffs = Hashdiff.diff(adapter.users_hash, Kaname::Resource.yaml)
diffs.each do |diff|
resource = diff[1].split('.')
if resource.size == 1 # "user"
if diff[0] == "+"