Sha256: 2dab97adeb72e5c97a5553fda234ac3aabc9b40da238efdcff5c6979e72f1fbe

Contents?: true

Size: 770 Bytes

Versions: 7

Compression:

Stored size: 770 Bytes

Contents

desc 'Reset FTP Library password'
arg_name 'account-id...'
command [:reset_ftp_password] do |c|

  c.action do |global_options,options,args|

    if args.empty?
      raise "You must specify the accounts to reset ftp passwords for"
    end

    accounts = Account.find_or_call(args) do |id|
      raise "Couldn't find account #{id}"
    end

    rows = []

    accounts.each do |s|
      info "Resetting ftp password for #{s}"
      new_password = s.reset_ftp_password
      o = s.to_row
      o[:library_ftp_password] = new_password
      rows << o
    end

    table_opts = global_options.merge({
      :vertical => true,
      :fields => [:id, :name, :library_ftp_host, :library_ftp_user, :library_ftp_password ]
    })

    render_table(rows, table_opts)

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bbcloud-0.11.2 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.11.1 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.11.0 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.10.1 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.9.2 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.9.1 lib/bbcloud/commands/accounts-reset-ftp-password.rb
bbcloud-0.9 lib/bbcloud/commands/accounts-reset-ftp-password.rb