lib/app42/command/service.rb in app42-0.5.3 vs lib/app42/command/service.rb in app42-0.5.4
- old
+ new
@@ -23,18 +23,18 @@
build_get_request params, 'service', nil
end
# ask service name to user
def ask_service_name
- service_name = input "Enter Service Name", [], true
+ service_name = ask Paint["Enter Service Name", :cyan]
valid_service_name = validate_app_and_service_name "Service name", service_name.strip
valid_service_name ? (return valid_service_name) : ask_service_name
end
# ask old password to user
- def ask_old_password
- input "Enter Old Password", [], true
+ def ask_service_token
+ input "Enter Service Token", [], true
end
# ask source id to user which he want to bind to service
def ask_source_ip what
ip = input "#{Message::BIND_NOTE}", [], true if what.to_s == 'bind'
@@ -97,11 +97,11 @@
end
# collect service name from user and proceed service resetPassword request
def reset_pass
@options[:service] = ask_service_name if @options[:service].nil?
- old_password = ask_old_password if is_service_exist? @options[:service]
- res = reset_password @options[:service], old_password
+ service_token = ask_service_token if is_service_exist? @options[:service]
+ res = reset_password @options[:service], service_token
(puts message "Your new password is: #{res['service']['password']}", false, 'green') && exit! if res
end
# collect service name,source IP and access time from user and proceed service resetPassword request
def service_bind
\ No newline at end of file