Changeset 2113 for trunk


Ignore:
Timestamp:
Feb 14, 2009, 6:13:55 PM (16 years ago)
Author:
iannucci
Message:

Modified invirt-availability and invirt-vmcontrol to stat /etc/invirt/nocreate.

Location:
trunk/packages/invirt-remote
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-remote/debian/changelog

    r2107 r2113  
     1invirt-remote (0.3.4) unstable; urgency=low
     2
     3  * modified host/usr/sbin/invirt-availability and invirt-vmcontrol to stat
     4    /etc/invirt/nocreate; if it exists, they advertise zero free memory and
     5    refuse to create VMs
     6
     7 -- Peter A. Iannucci <iannucci@mit.edu>  Sat, 14 Feb 2009 18:10:54 -0500
     8
    19invirt-remote (0.3.3) unstable; urgency=low
    210
  • trunk/packages/invirt-remote/host/usr/sbin/invirt-availability

    r2107 r2113  
    2020    All math is done in kilobytes for consistency
    2121    Output is in MB
     22
     23    Bail if /etc/invirt/nocreate exists
    2224    """
     25    try:
     26        os.stat('/etc/invirt/nocreate')
     27        print 0
     28        return 0
     29    except OSError:
     30        pass
     31
    2332    p = Popen(['/usr/sbin/xm', 'info'], stdout=PIPE)
    2433    output = p.communicate()[0]
  • trunk/packages/invirt-remote/host/usr/sbin/invirt-vmcontrol

    r2097 r2113  
    2323    install|create)
    2424        shift; shift;
     25        if [ -f "/etc/invirt/nocreate" ]; then
     26                echo "Host $HOSTNAME is currently refusing VM creation." && exit 2
     27        fi
    2528        xm list "$MACHINE" >/dev/null 2>/dev/null && echo "$MACHINE already exists" && exit 1
    2629        if [ "$ACTION" = "install" ]; then
Note: See TracChangeset for help on using the changeset viewer.