Libvirt LXC: allow to check for container existence and status #585

Merged
merged 1 commit into from Oct 11, 2016

Conversation

Projects
None yet
2 participants
@agx
Contributor

agx commented Oct 4, 2016

This is similar to LXC but libvirt-lxc containers are implemented
differently and need the libvirt tools to check existence and status.

agx added a commit to agx/serverspec that referenced this pull request Oct 4, 2016

@agx agx referenced this pull request in mizzy/serverspec Oct 4, 2016

Closed

Add libvirt_lxc #579

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Oct 5, 2016

Owner

Please modify lib/specinfra/command/linux/base/lxc_container.rb like this.

    def check_exists(container)
      [
       "lxc-ls -1 | grep -w #{escape(container)}",
        "virsh -c lxc:/// list --all --name | grep -w '^#{escape(container)}$'"
      ].join(' || ')
    end
Owner

mizzy commented Oct 5, 2016

Please modify lib/specinfra/command/linux/base/lxc_container.rb like this.

    def check_exists(container)
      [
       "lxc-ls -1 | grep -w #{escape(container)}",
        "virsh -c lxc:/// list --all --name | grep -w '^#{escape(container)}$'"
      ].join(' || ')
    end
@agx

This comment has been minimized.

Show comment
Hide comment
@agx

agx Oct 7, 2016

Contributor

@mizzy updated.

Contributor

agx commented Oct 7, 2016

@mizzy updated.

@agx

This comment has been minimized.

Show comment
Hide comment
@agx

agx Oct 7, 2016

Contributor

Not needed when we handle LibvirtLXC in LXC as @mizzy suggested.

Contributor

agx commented Oct 7, 2016

Not needed when we handle LibvirtLXC in LXC as @mizzy suggested.

@agx agx closed this Oct 7, 2016

@agx agx reopened this Oct 8, 2016

@agx

This comment has been minimized.

Show comment
Hide comment
@agx

agx Oct 8, 2016

Contributor

Argh, i closed the wrong one. Meant to close the one on serverspec. Sorry

Contributor

agx commented Oct 8, 2016

Argh, i closed the wrong one. Meant to close the one on serverspec. Sorry

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Oct 11, 2016

Owner

Thanks!

Owner

mizzy commented Oct 11, 2016

Thanks!

@mizzy mizzy merged commit f5bb203 into mizzy:master Oct 11, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Oct 11, 2016

Owner

Released as v2.63.3.

Owner

mizzy commented Oct 11, 2016

Released as v2.63.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment