hammer_cli_foreman_bootdisk 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_foreman_bootdisk/bootdisk.rb +2 -0
  3. data/lib/hammer_cli_foreman_bootdisk/commands.rb +13 -11
  4. data/lib/hammer_cli_foreman_bootdisk/i18n.rb +2 -3
  5. data/lib/hammer_cli_foreman_bootdisk/version.rb +3 -1
  6. data/lib/hammer_cli_foreman_bootdisk.rb +7 -6
  7. data/locale/ca/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  8. data/locale/ca/hammer_cli_foreman_bootdisk.po +1 -1
  9. data/locale/de/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  10. data/locale/de/hammer_cli_foreman_bootdisk.po +1 -1
  11. data/locale/en/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  12. data/locale/en/hammer_cli_foreman_bootdisk.po +1 -1
  13. data/locale/en_GB/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  14. data/locale/en_GB/hammer_cli_foreman_bootdisk.po +1 -1
  15. data/locale/es/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  16. data/locale/es/hammer_cli_foreman_bootdisk.po +4 -4
  17. data/locale/fr/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  18. data/locale/fr/hammer_cli_foreman_bootdisk.po +1 -1
  19. data/locale/it/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  20. data/locale/it/hammer_cli_foreman_bootdisk.po +1 -1
  21. data/locale/ja/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  22. data/locale/ja/hammer_cli_foreman_bootdisk.po +2 -1
  23. data/locale/ka/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  24. data/locale/ka/hammer_cli_foreman_bootdisk.po +1 -1
  25. data/locale/ko/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  26. data/locale/ko/hammer_cli_foreman_bootdisk.po +3 -3
  27. data/locale/nl_NL/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  28. data/locale/nl_NL/hammer_cli_foreman_bootdisk.po +1 -1
  29. data/locale/pt_BR/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  30. data/locale/pt_BR/hammer_cli_foreman_bootdisk.po +1 -1
  31. data/locale/ru/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  32. data/locale/ru/hammer_cli_foreman_bootdisk.po +1 -1
  33. data/locale/zh_CN/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  34. data/locale/zh_CN/hammer_cli_foreman_bootdisk.po +1 -1
  35. data/locale/zh_TW/LC_MESSAGES/hammer_cli_foreman_bootdisk.mo +0 -0
  36. data/locale/zh_TW/hammer_cli_foreman_bootdisk.po +1 -1
  37. metadata +26 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6a7c3f5abe5275511c75954d6aaa5979dd143fc11fd3b9cae08c7513cf37f41
4
- data.tar.gz: 9be6c7b102a5e1bd0974c8ab76fb383f12fdc7d948be9f3146fff7bb2ad6da9a
3
+ metadata.gz: a34b23ec2891310027a30ae7a439dec41bbf4e0a7fb5ce612293737e88e93579
4
+ data.tar.gz: 9b686e74a50cdd811333f782d8423de7329b8f1b1188f28adf211a4f5668c970
5
5
  SHA512:
6
- metadata.gz: 27dfa33a66f56e5493a2127c2b553a635bcf91137c833998f96b68d44f1daba15472664091340b23c80074634da744849d03d09e4adba0604396aecc0fa4bd0f
7
- data.tar.gz: 8b78e5216fa350a7040cca19a8981746140f74d164ba9172f8af3f3798509d37269961b7a53150f9fbe6c837cdfd802d40e175fc1b8fe2967df47a6572f2aa13
6
+ metadata.gz: 433d40cdb07f6cf630ded316b07ed8bad761832ab7afb688fc8eccfc507aa2705d67eb20c8d3c3d7e3bbd518453487908e50958d09ace72544e103d7c93f6894
7
+ data.tar.gz: c5f3aaead067229bb870b8c68fee456d655ca0b28112b5810166bf248d7ae2196da3a81628af9b27fc6b01088cf3c0a37a4d425abff19d095a5c51929a7bc4be
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HammerCLIForemanBootdisk
2
4
  class Bootdisk < HammerCLIForeman::Command
3
5
  resource :disks
@@ -1,36 +1,38 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tempfile'
2
4
  require 'hammer_cli_foreman/commands'
3
5
 
4
6
  module HammerCLIForemanBootdisk
5
7
  class DownloadCommand < HammerCLIForeman::Command
6
- option "--file", "PATH", _("File or device to write image to")
7
- option "--force", :flag, _("Force writing to existing destination (device etc.)")
8
- option "--sudo", :flag, _("Use sudo to write to device")
8
+ option '--file', 'PATH', _('File or device to write image to')
9
+ option '--force', :flag, _('Force writing to existing destination (device etc.)')
10
+ option '--sudo', :flag, _('Use sudo to write to device')
9
11
 
12
+ # rubocop:disable Layout/LineLength
10
13
  def print_data(record)
11
- server_filename = $1 if record.headers[:content_disposition] =~ /filename=["']?([^\s,;"']+)/
14
+ server_filename = ::Regexp.last_match(1) if record.headers[:content_disposition].match?(/filename=["']?([^\s,;"']+)/)
12
15
  file = options[HammerCLI.option_accessor_name('file')] || server_filename || 'bootdisk.iso'
13
- if !options[HammerCLI.option_accessor_name('force')] && File.exist?(file) && !File.file?(file)
14
- raise(HammerCLIForeman::OperationNotSupportedError, _("Destination %s already exists and isn't a regular file, use '--force' if you are sure you wish to write to it") % file)
15
- end
16
+ raise(HammerCLIForeman::OperationNotSupportedError, _("Destination %s already exists and isn't a regular file, use '--force' if you are sure you wish to write to it") % file) if !options[HammerCLI.option_accessor_name('force')] && File.exist?(file) && !File.file?(file)
16
17
 
17
18
  if options[HammerCLI.option_accessor_name('sudo')]
18
19
  temp_file = Tempfile.new('bootdisk')
19
20
  begin
20
- File.open(temp_file, 'w') { |f| f.write(record) }
21
+ File.write(temp_file, record)
21
22
  system('sudo', 'dd', "if=#{temp_file.path}", "of=#{file}", 'bs=1024')
22
23
  ensure
23
24
  temp_file.close
24
25
  temp_file.unlink
25
26
  end
26
27
  else
27
- File.open(file, 'w') { |f| f.write(record) }
28
+ File.write(file, record)
28
29
  end
29
- print_message (success_message % file) if success_message
30
+ print_message(success_message % file) if success_message
30
31
  end
32
+ # rubocop:enable Layout/LineLength
31
33
 
32
34
  def request_options
33
- {:response => :raw}
35
+ { response: :raw }
34
36
  end
35
37
  end
36
38
  end
@@ -1,10 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hammer_cli/i18n'
2
4
 
3
5
  module HammerCLIForemanBootdisk
4
6
  module I18n
5
-
6
7
  class LocaleDomain < HammerCLI::I18n::LocaleDomain
7
-
8
8
  def translated_files
9
9
  Dir.glob(File.join(File.dirname(__FILE__), '../**/*.rb'))
10
10
  end
@@ -17,7 +17,6 @@ module HammerCLIForemanBootdisk
17
17
  'hammer_cli_foreman_bootdisk'
18
18
  end
19
19
  end
20
-
21
20
  end
22
21
  end
23
22
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HammerCLIForemanBootdisk
2
4
  def self.version
3
- @version ||= Gem::Version.new '0.4.0'
5
+ @version ||= Gem::Version.new '0.4.2'
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hammer_cli_foreman'
2
4
 
3
5
  module HammerCLIForemanBootdisk
@@ -9,12 +11,11 @@ module HammerCLIForemanBootdisk
9
11
  require 'hammer_cli_foreman_bootdisk/commands'
10
12
  require 'hammer_cli_foreman_bootdisk/version'
11
13
 
12
- HammerCLI::MainCommand.lazy_subcommand('bootdisk', _("Download boot disks"),
13
- 'HammerCLIForemanBootdisk::Bootdisk', 'hammer_cli_foreman_bootdisk/bootdisk'
14
- )
15
- rescue => e
16
- handler = HammerCLIForeman::ExceptionHandler.new(:context => {}, :adapter => :base)
14
+ HammerCLI::MainCommand.lazy_subcommand('bootdisk', _('Download boot disks'),
15
+ 'HammerCLIForemanBootdisk::Bootdisk', 'hammer_cli_foreman_bootdisk/bootdisk')
16
+ rescue StandardError => e
17
+ handler = HammerCLIForeman::ExceptionHandler.new(context: {}, adapter: :base)
17
18
  handler.handle_exception(e)
18
- raise HammerCLI::ModuleLoadingError.new(e)
19
+ raise HammerCLI::ModuleLoadingError, e
19
20
  end
20
21
  end
@@ -6,7 +6,7 @@
6
6
  # Robert Antoni Buj i Gelonch <rbuj@fedoraproject.org>, 2015-2016
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -7,7 +7,7 @@
7
7
  # simon11 <transifex@stieger.co>, 2014
8
8
  msgid ""
9
9
  msgstr ""
10
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
10
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
12
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
13
13
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -5,7 +5,7 @@
5
5
  #
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
8
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
11
11
  "PO-Revision-Date: 2019-06-20 10:23+0200\n"
@@ -6,7 +6,7 @@
6
6
  # Andi Chandler <andi@gowling.com>, 2015-2016
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -4,15 +4,15 @@
4
4
  #
5
5
  # Translators:
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
- # Sergio Ocón-Cárdenas <sergio.ocon@redhat.com>, 2014
8
- # Sergio Ocón-Cárdenas <sergio.ocon@redhat.com>, 2014
7
+ # Sergio Ocón-Cárdenas, 2014
8
+ # Sergio Ocón-Cárdenas, 2014
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
11
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
14
14
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
15
- "Last-Translator: Sergio Ocón-Cárdenas <sergio.ocon@redhat.com>, 2014\n"
15
+ "Last-Translator: Sergio Ocón-Cárdenas, 2014\n"
16
16
  "Language-Team: Spanish (http://app.transifex.com/foreman/foreman/language/"
17
17
  "es/)\n"
18
18
  "MIME-Version: 1.0\n"
@@ -7,7 +7,7 @@
7
7
  # Pierre-Emmanuel Dutang <dutangp@gmail.com>, 2014
8
8
  msgid ""
9
9
  msgstr ""
10
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
10
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
12
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
13
13
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -6,7 +6,7 @@
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -5,9 +5,10 @@
5
5
  # Translators:
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  # 山田 修司 🍣 Shuji Yamada <uzy.exe@gmail.com>, 2015
8
+ # 山田 修司 🍣 Shuji Yamada <uzy.exe@gmail.com>, 2015
8
9
  msgid ""
9
10
  msgstr ""
10
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
11
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
11
12
  "Report-Msgid-Bugs-To: \n"
12
13
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
13
14
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -5,7 +5,7 @@
5
5
  # Translators:
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
8
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
11
11
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -6,7 +6,7 @@
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -35,10 +35,10 @@ msgid "Failed to download host disk image"
35
35
  msgstr "호스트 디스크 이미지 다운로드에 실패했습니다 "
36
36
 
37
37
  msgid "Successfully downloaded subnet disk image to %s"
38
- msgstr ""
38
+ msgstr "서브넷 디스크 이미지를 %s로 성공적으로 다운로드했습니다."
39
39
 
40
40
  msgid "Failed to download subnet disk image"
41
- msgstr ""
41
+ msgstr "서브넷 디스크 이미지 다운로드에 실패했습니다."
42
42
 
43
43
  msgid "File or device to write image to"
44
44
  msgstr "이미지를 작성할 파일 또는 장치 "
@@ -6,7 +6,7 @@
6
6
  # EmielK <emiel@kremers.us>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -6,7 +6,7 @@
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -8,7 +8,7 @@
8
8
  # Yulia <yulia.poyarkova@redhat.com>, 2016
9
9
  msgid ""
10
10
  msgstr ""
11
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
11
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
12
12
  "Report-Msgid-Bugs-To: \n"
13
13
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
14
14
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -6,7 +6,7 @@
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
@@ -6,7 +6,7 @@
6
6
  # Dominic Cleal <dcleal@redhat.com>, 2014
7
7
  msgid ""
8
8
  msgstr ""
9
- "Project-Id-Version: hammer_cli_foreman_bootdisk 0.3.0\n"
9
+ "Project-Id-Version: hammer_cli_foreman_bootdisk 0.4.1\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
11
  "POT-Creation-Date: 2019-06-20 10:23+0200\n"
12
12
  "PO-Revision-Date: 2014-08-08 16:21+0000\n"
metadata CHANGED
@@ -1,29 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_bootdisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: hammer_cli_foreman
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 0.1.2
18
+ version: '3.10'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 0.1.2
25
+ version: '3.10'
26
+ - !ruby/object:Gem::Dependency
27
+ name: theforeman-rubocop
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: 0.1.0
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: 0.1.0
27
40
  description: Foreman boot disk commands for Hammer CLI
28
41
  email: dcleal@redhat.com
29
42
  executables: []
@@ -75,9 +88,8 @@ files:
75
88
  - locale/zh_TW/hammer_cli_foreman_bootdisk.po
76
89
  homepage: https://github.com/theforeman/hammer_cli_foreman_bootdisk
77
90
  licenses:
78
- - GPL-3.0+
91
+ - GPL-3.0-or-later
79
92
  metadata: {}
80
- post_install_message:
81
93
  rdoc_options: []
82
94
  require_paths:
83
95
  - lib
@@ -85,15 +97,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
97
  requirements:
86
98
  - - ">="
87
99
  - !ruby/object:Gem::Version
88
- version: '0'
100
+ version: '2.7'
101
+ - - "<"
102
+ - !ruby/object:Gem::Version
103
+ version: '4'
89
104
  required_rubygems_version: !ruby/object:Gem::Requirement
90
105
  requirements:
91
106
  - - ">="
92
107
  - !ruby/object:Gem::Version
93
108
  version: '0'
94
109
  requirements: []
95
- rubygems_version: 3.2.33
96
- signing_key:
110
+ rubygems_version: 3.6.9
97
111
  specification_version: 4
98
112
  summary: Foreman boot disk commands for Hammer
99
113
  test_files: []