Class: HammerCLIKatello::Repository::UploadContentCommand
- Inherits:
-
InfoCommand
- Object
- HammerCLIForeman::InfoCommand
- InfoCommand
- HammerCLIKatello::Repository::UploadContentCommand
- Defined in:
- lib/hammer_cli_katello/repository.rb
Defined Under Namespace
Classes: BinaryPath
Constant Summary collapse
- CONTENT_CHUNK_SIZE =
bytes
4_000_000
Instance Method Summary collapse
Methods included from HammerCLIKatello::RepositoryScopedToProduct
Methods included from HammerCLIKatello::ResolverCommons
Instance Method Details
#content_upload_resource ⇒ Object
216 217 218 |
# File 'lib/hammer_cli_katello/repository.rb', line 216 def content_upload_resource ::HammerCLIForeman.foreman_resource(:content_uploads) end |
#execute ⇒ Object
207 208 209 210 211 212 213 214 |
# File 'lib/hammer_cli_katello/repository.rb', line 207 def execute @failure = false option_content.each do |file_path| File.open(file_path, 'rb') { |file| upload_file file } end @failure ? HammerCLI::EX_DATAERR : HammerCLI::EX_OK end |
#request_headers ⇒ Object
203 204 205 |
# File 'lib/hammer_cli_katello/repository.rb', line 203 def request_headers {:content_type => 'multipart/form-data'} end |