morpheus-cli 3.6.3 → 3.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,7 +45,8 @@ class Morpheus::Cli::Shell
45
45
  @current_remote = ::Morpheus::Cli::Remote.load_active_remote()
46
46
  if @current_remote
47
47
  @appliance_name, @appliance_url = @current_remote[:name], @current_remote[:host]
48
- @current_username = @current_remote[:username] || '(anonymous)'
48
+ # @current_username = @current_remote[:username] || '(anonymous)'
49
+ @current_username = @current_remote[:username] || ''
49
50
  else
50
51
  @appliance_name, @appliance_url = nil, nil
51
52
  @current_username = nil
@@ -371,7 +372,7 @@ class Morpheus::Cli::Shell
371
372
  #print "\n"
372
373
  return 0
373
374
  elsif input =~ /^\s*#/
374
- Morpheus::Logging::DarkPrinter.puts "comment ignored" if Morpheus::Logging.debug?
375
+ Morpheus::Logging::DarkPrinter.puts "ignored comment: #{input}" if Morpheus::Logging.debug?
375
376
  return 0
376
377
  # this is a full blown command now
377
378
  # elsif input =~ /^sleep/
@@ -663,7 +664,7 @@ class Morpheus::Cli::Shell
663
664
  @last_command_number += 1
664
665
  @history[@last_command_number] = cmd
665
666
  if @history_logger
666
- @history_logger.info "(cmd #{@last_command_number}) #{cmd}"
667
+ @history_logger.info "#{@current_username}@#{@appliance_name} : -- : (cmd #{@last_command_number}) #{cmd}"
667
668
  end
668
669
  end
669
670
  end
@@ -25,6 +25,7 @@ class Morpheus::Cli::SourceCommand
25
25
  source_files = args
26
26
  source_files.each do |source_file|
27
27
  # execute a source script
28
+ source_file = File.expand_path(source_file)
28
29
  if File.exists?(source_file)
29
30
  cmd_results = Morpheus::Cli::DotFile.new(source_file).execute()
30
31
  else
@@ -275,6 +275,15 @@ class Morpheus::Cli::StorageProvidersCommand
275
275
  {'fieldName' => 'bucketName', 'fieldLabel' => 'Bucket Name', 'type' => 'text', 'required' => true, 'description' => ''},
276
276
  {'fieldName' => 'createBucket', 'fieldLabel' => 'Create Bucket', 'type' => 'checkbox', 'required' => false, 'defaultValue' => false, 'description' => 'Create the bucket if it does not exist.'},
277
277
  ]
278
+ elsif storage_provider_type_code == 'alibaba'
279
+ # print_h2 "Alibaba Options"
280
+ provider_type_option_types = [
281
+ {'fieldContext' => 'config', 'fieldName' => 'accessKey', 'fieldLabel' => 'Access Key', 'type' => 'text', 'required' => true, 'description' => ''},
282
+ {'fieldContext' => 'config', 'fieldName' => 'secretKey', 'fieldLabel' => 'Secret Key', 'type' => 'password', 'required' => true, 'description' => ''},
283
+ {'fieldName' => 'bucketName', 'fieldLabel' => 'Bucket Name', 'type' => 'text', 'required' => true, 'description' => ''},
284
+ {'fieldName' => 'createBucket', 'fieldLabel' => 'Create Bucket', 'type' => 'checkbox', 'required' => false, 'defaultValue' => false, 'description' => 'Create the bucket if it does not exist.'},
285
+ {'fieldContext' => 'config', 'fieldName' => 'region', 'fieldLabel' => 'Region', 'type' => 'text', 'required' => false, 'description' => 'Optional Alibaba region if creating a new bucket.'}
286
+ ]
278
287
  elsif storage_provider_type_code == 'cifs'
279
288
  # print_h2 "CIFS Options"
280
289
  provider_type_option_types = [
@@ -1222,6 +1231,7 @@ class Morpheus::Cli::StorageProvidersCommand
1222
1231
  def get_storage_provider_types()
1223
1232
  [
1224
1233
  {'name' => 'Amazon S3', 'value' => 's3'},
1234
+ {'name' => 'Alibaba', 'value' => 'alibaba'},
1225
1235
  {'name' => 'Azure', 'value' => 'azure'},
1226
1236
  {'name' => 'CIFS', 'value' => 'cifs'},
1227
1237
  {'name' => 'Local Storage', 'value' => 'local'},
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "3.6.3"
4
+ VERSION = "3.6.4"
5
5
  end
6
6
  end
@@ -274,13 +274,13 @@ def filter_data(data, include_fields=nil, exclude_fields=nil)
274
274
  end
275
275
  end
276
276
 
277
- def format_bytes(bytes)
277
+ def format_bytes(bytes, units="B")
278
278
  out = ""
279
279
  if bytes
280
- if bytes < 1024
280
+ if bytes < 1024 && units == "B"
281
281
  out = "#{bytes.to_i} B"
282
282
  else
283
- out = Filesize.from("#{bytes} B").pretty.strip
283
+ out = Filesize.from("#{bytes} #{units}").pretty.strip
284
284
  end
285
285
  end
286
286
  return out
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpheus-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.3
4
+ version: 3.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-01-24 00:00:00.000000000 Z
14
+ date: 2019-02-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -259,6 +259,7 @@ files:
259
259
  - lib/morpheus/cli/clouds.rb
260
260
  - lib/morpheus/cli/coloring_command.rb
261
261
  - lib/morpheus/cli/command_error.rb
262
+ - lib/morpheus/cli/commands/standard/cat_command.rb
262
263
  - lib/morpheus/cli/commands/standard/exit_command.rb
263
264
  - lib/morpheus/cli/containers_command.rb
264
265
  - lib/morpheus/cli/credentials.rb