+invirt-remote-server (0.0.15) unstable; urgency=low
+
+ * Include invirt.remote Python module
+
+ -- Evan Broder <broder@mit.edu> Mon, 10 Nov 2008 15:15:13 -0500
+
invirt-remote-server (0.0.14) unstable; urgency=low
* Don't depend on invirt-mail-config
Source: invirt-remote-server
Section: servers
Priority: important
-Maintainer: invirt@mit.edu
-Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5)
-Standards-Version: 3.7.2
+Maintainer: Invirt project <invirt@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5),
+ python-all-dev (>=2.3.5-11), python-support (>= 0.5.3),
+ python-setuptools, python-debian, python-apt
+Standards-Version: 3.8.0
Package: invirt-remote-server
Architecture: all
-Provides: ${diverted-files}
+Provides: ${diverted-files}, ${python:Provides}
Conflicts: ${diverted-files}
-Depends: ${shlibs:Depends}, ${misc:Depends}, daemon,
- debathena-kerberos-config, fuse-utils, openssh-server,
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends},
+ daemon, debathena-kerberos-config, fuse-utils, openssh-server,
python-routefs, invirt-database, invirt-base, remctl-server,
remctl-client
+XB-Python-Version: ${python:Versions}
Description: Invirt remote-control server
This package should be installed to set up the remote-control server.
#!/usr/bin/make -f
+DEB_PYTHON_SYSTEM=pysupport
+
include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+clean::
+ rm -rf invirt.remote.egg-info
--- /dev/null
+from bcast import bcast
--- /dev/null
+from subprocess import PIPE, Popen
+from invirt.config import structs as config
+import yaml
+
+def bcast(cmd, hosts = [h.hostname for h in config.hosts]):
+ """
+ Given a command and a list of hostnames or IPs, issue the command to all
+ the nodes and return a list of (host, output) pairs (the order should be
+ the same as the order of the hosts).
+ """
+ pipes = [(host,
+ Popen(['remctl', host, 'remote', 'web', cmd], stdout=PIPE))
+ for host in hosts]
+ outputs = [(s, p.communicate()[0]) for (s, p) in pipes]
+ for (s, p) in pipes:
+ if p.returncode != 0:
+ raise RuntimeError("remctl to host %s returned non-zero exit status %d"
+ % (s, p.returncode))
+ return [(s, yaml.load(o, yaml.CSafeLoader)) for (s, o) in outputs]
--- /dev/null
+#!/usr/bin/python
+
+from os import path
+from debian_bundle.changelog import Changelog
+from debian_bundle.deb822 import Deb822
+from email.utils import parseaddr
+from setuptools import setup
+
+version = Changelog(open(path.join(path.dirname(__file__), 'debian/changelog')).read()).\
+ get_version().full_version
+
+maintainer_full = Deb822(open(path.join(path.dirname(__file__), 'debian/control')))['Maintainer']
+maintainer, maintainer_email = parseaddr(maintainer_full)
+
+setup(
+ name='invirt.remote',
+ version=version,
+ maintainer=maintainer,
+ maintainer_email=maintainer_email,
+
+ packages = ['invirt.remote'],
+ package_dir = {'invirt': 'python'}
+)