lib/nexussw/lxd/driver/mixins/cli.rb in lxd-common-0.4.1 vs lib/nexussw/lxd/driver/mixins/cli.rb in lxd-common-0.5.0
- old
+ new
@@ -1,5 +1,7 @@
+require 'nexussw/lxd/driver/mixins/helpers/wait'
+require 'nexussw/lxd/transport/cli'
require 'tempfile'
require 'yaml'
require 'json'
module NexusSW
@@ -12,10 +14,14 @@
@driver_options = driver_options || {}
end
attr_reader :inner_transport, :driver_options
+ def transport_for(container_name)
+ Transport::CLI.new inner_transport, container_name, info: YAML.load(inner_transport.execute('lxc info').error!.stdout)
+ end
+
def create_container(container_name, container_options = {})
if container_exists? container_name
start_container container_name # Start for Parity with the below logic (`lxc launch` auto starts)
return container_name
end
@@ -107,10 +113,10 @@
return false
rescue
false
end
- include WaitMixin
+ include Helpers::WaitMixin
protected
def wait_for_status(container_id, newstatus)
loop do