[Libvirt-cim] [PATCH 1 of 3] [TEST] add lxc file creation function

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue May 20 18:21:22 UTC 2008


Guo Lian Yun wrote:
> # HG changeset patch
> # User Guolian Yun <yunguol at cn.ibm.com>
> # Date 1211269259 25200
> # Node ID 5f0a469e6a9a1fe02cc26a9f81e87a80286a43d5
> # Parent  b2b2bb6cc8d87ba0eeddcf3d361d3085104d3492
> [TEST] add lxc file creation function
> 
> Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>
> 
> diff -r b2b2bb6cc8d8 -r 5f0a469e6a9a suites/libvirt-cim/lib/XenKvmLib/common_util.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py	Mon May 19 10:43:33 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py	Tue May 20 00:40:59 2008 -0700
> @@ -359,3 +359,16 @@ def create_netpool_conf(server, virt):
>          logger.error("Exception: In fn create_netpool_conf(): %s", detail)
>          status=FAIL
>      return status, test_network
> +
> +def create_lxc_file(lxc_file):
> +    status = PASS
> +    try:
> +        f = open(lxc_file, 'w')
> +        f.write('%s' % 'exec /bin/sh')
> +        f.close()
> +    except Exception,detail:
> +        logger.error("Exception: %s", detail)
> +    
> +    if status != PASS:

status doesn't get set to FAIL in this function, so this function will 
always pass.

Also, you'll need to modify the permissions of the script so that it is 
an executable.  Otherwise, the container will be unable to run the script.

> +        logger.error("Creation of LXC file Failed")
> +    return status

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list