Class: Lxc::Clone
- Inherits:
-
Object
- Object
- Lxc::Clone
- Includes:
- Helpers, Helpers::Copies, Helpers::Options
- Defined in:
- lib/elecksee/clone.rb
Overview
Clone existing containers
Constant Summary
Constants included from Helpers::Copies
Helpers::Copies::HOSTNAME_FILES, Helpers::Copies::NAME_FILES
Instance Attribute Summary collapse
-
#lxcs ⇒ Hash
readonly
Original and new container instances.
Instance Method Summary collapse
-
#clone! ⇒ Lxc
Create the clone.
-
#initialize(args = {}) ⇒ Clone
constructor
Create new instance.
Methods included from Helpers::Copies
#apply_custom_networking, #el_platform?, #update_naming, #update_net_hwaddr, #update_rootfs, #write_file
Methods included from Helpers::Options
Methods included from Helpers
#child_process_command, #detect_home, #log, #mixlib_shellout_command, #run_command, #sudo
Constructor Details
Instance Attribute Details
#lxcs ⇒ Hash (readonly)
Returns original and new container instances.
24 25 26 |
# File 'lib/elecksee/clone.rb', line 24 def lxcs @lxcs end |
Instance Method Details
#clone! ⇒ Lxc
Create the clone
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/elecksee/clone.rb', line 43 def clone! begin copy_original update_naming(:no_config) apply_custom_addressing if ipaddress lxc rescue Exception @created.map(&:destroy) raise end end |