ADDED .pylintrc Index: .pylintrc ================================================================== --- .pylintrc +++ .pylintrc @@ -0,0 +1,1 @@ +good-names: i,j,k,f,r,ex Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -31,13 +31,13 @@ $(INSTALL) -c -m 644 -o root vws.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) -c -m 644 -o root find_free_port.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) -c -m 644 -o root vws.service $(DESTDIR)$(systemddir) $(INSTALL) -c -m 644 -o root vws.init $(DESTDIR)$(initddir)/vws -origtarball: vws find_free_port vws.init vws.service.in Makefile vws.conf vws.mkd find_free_port.mkd +origtarball: vws find_free_port vws.init vws.service.in Makefile vws.conf vws.mkd find_free_port.mkd .pylintrc version=$$(sed -n 's/VERSION = //p' vws); \ mkdir vws-$$version; cp $+ vws-$$version; \ tar cjf ../vws_$$version.orig.tar.bz2 vws-$$version; \ rm -rf vws-$$version deb: origtarball debuild Index: vws ================================================================== --- vws +++ vws @@ -586,11 +586,11 @@ start_opts = Namespace(machine = name, command = 'start', dir = machine_dir, snapshot = False, stopped = True, - password = None, + password = None, args = "", gui = False, cdrom = None) try: cmd_start(start_opts) @@ -680,11 +680,11 @@ -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \\ -device ich9-usb-ehci1,id=usb \\ -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on \\ -chardev spicevmc,name=usbredir,id=usbredirchardev1 \\ -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1 \\ --daemonize -pidfile pid +-daemonize -pidfile pid {extraargs} chgrp {group} monitor pid chmod 0660 monitor pid """ def cmd_create(parsed_args): @@ -703,11 +703,12 @@ "drive":"-drive media=disk,index=0,if={interface},file={image}", "cdrom":"-drive media=cdrom,index=2,if=ide", "sound":"-soundhw hda", "group":config.get("permissions","vm_group"), "usb":"-usb", - "rtc":""} + "rtc":"", + "extraargs":"${1:+\"$@\"}"} macaddr = ":".join(["%02x" % ord(x) for x in chr(0x52) + os.urandom(5)]) if parsed_args.shared: machinedir = os.path.join(config.get("directories", "SharedVMs"), parsed_args.machine) dirmode = 0775 @@ -792,19 +793,20 @@ with open("start", "w") as script: script.write(TEMPLATE.format(**options)) os.chmod('start', dirmode) # If installation media is specified vws start for new vm if parsed_args.install: - start_opts = Namespace(machine=parsed_args.machine, + start_opts = Namespace(machine=parsed_args.machine,password=None, command='start', cdrom=[install_image], dir=machinedir, stopped=True, snapshot=False, args="", gui=True) try: cmd_start(start_opts) finally: # pylint: disable=no-member - start_opts.sock.shutdown(socket.SHUT_RDWR) + if hasattr(start_opts,"sock"): + start_opts.sock.shutdown(socket.SHUT_RDWR) # # Utility functions for arg parsing # def new_command(cmd_parser, name, **kwargs):