Re: [sandbox PATCH 2/3] Only create the destination path if it does not exist.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 22, 2013 at 12:26:30PM -0400, dwalsh@xxxxxxxxxx wrote:
> From: Dan Walsh <dwalsh@xxxxxxxxxx>
> 
> OpenShift will be creating the path within its management layer.
> ---
>  bin/virt-sandbox-service | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
> index 31aa6a1..dd30993 100755
> --- a/bin/virt-sandbox-service
> +++ b/bin/virt-sandbox-service
> @@ -272,7 +272,8 @@ class Container:
>      def create(self):
>          self.connect()
>          self.config.set_shell(True)
> -        os.mkdir(self.dest)
> +        if not os.path.exists(self.dest):
> +            os.mkdir(self.dest)
>  
>      def connect(self):
>          if not self.conn:

ACK to this chunk.

> @@ -331,6 +332,9 @@ class GenericContainer(Container):
>          self.save_config()
>  
>      def create(self):
> +        config_path = self.get_config_path()
> +        if os.path.exists(config_path):
> +            raise ValueError([_("%s already exists") % config_path ])

This appears to be unrelated to the subject of this patch. Please move
it to a separate commit.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]