Revision 2d48a3a2

b/Makefile.am
17 17
CHECK_MAN = $(top_srcdir)/autotools/check-man
18 18
REPLACE_VARS_SED = autotools/replace_vars.sed
19 19

  
20
clientdir = $(pkgpythondir)/client
20 21
hypervisordir = $(pkgpythondir)/hypervisor
21 22
httpdir = $(pkgpythondir)/http
22 23
masterddir = $(pkgpythondir)/masterd
......
38 39
	doc/examples/hooks \
39 40
	doc/examples/gnt-debug \
40 41
	lib \
42
	lib/client \
41 43
	lib/build \
42 44
	lib/confd \
43 45
	lib/http \
......
74 76

  
75 77
CLEANFILES = \
76 78
	$(addsuffix /*.py[co],$(DIRS)) \
79
	$(PYTHON_BOOTSTRAP) \
77 80
	autotools/replace_vars.sed \
78 81
	daemons/daemon-util \
79 82
	daemons/ensure-dirs \
......
134 137
	lib/uidpool.py \
135 138
	lib/workerpool.py
136 139

  
140
client_PYTHON = \
141
	lib/client/__init__.py
142

  
137 143
hypervisor_PYTHON = \
138 144
	lib/hypervisor/__init__.py \
139 145
	lib/hypervisor/hv_base.py \
......
248 254
	scripts/gnt-node \
249 255
	scripts/gnt-os
250 256

  
257
PYTHON_BOOTSTRAP =
258

  
251 259
dist_sbin_SCRIPTS = \
252 260
	daemons/ganeti-noded \
253 261
	daemons/ganeti-watcher \
......
257 265
	$(gnt_scripts)
258 266

  
259 267
nodist_sbin_SCRIPTS = \
268
	$(PYTHON_BOOTSTRAP) \
260 269
	daemons/ganeti-cleaner
261 270

  
262 271
dist_tools_SCRIPTS = \
......
431 440
	$(pkglib_python_scripts) \
432 441
	$(python_tests) \
433 442
	$(pkgpython_PYTHON) \
443
	$(client_PYTHON) \
434 444
	$(hypervisor_PYTHON) \
435 445
	$(rapi_PYTHON) \
436 446
	$(http_PYTHON) \
......
605 615
	  echo 's#@GNTDAEMONSGROUP@#$(DAEMONS_GROUP)#g'; \
606 616
	} > $@
607 617

  
618
$(PYTHON_BOOTSTRAP): Makefile
619
	set -e; \
620
	module='$(subst -,_,$(notdir $@))'; \
621
	{ echo "#!$(PYTHON)"; \
622
	  echo '# This file is automatically generated, do not edit!'; \
623
	  echo "# Edit ganeti.client.$$module instead."; \
624
	  echo; \
625
	  echo '"""Bootstrap script for L{ganeti.client.'"$$module"'}"""'; \
626
	  echo; \
627
	  echo '# pylint: disable-msg=C0103'; \
628
	  echo '# C0103: Invalid name'; \
629
	  echo; \
630
	  echo 'import sys'; \
631
	  echo "from ganeti.client import $$module"; \
632
	  echo; \
633
	  echo '# Temporarily alias commands until bash completion'; \
634
	  echo '# generator is changed'; \
635
	  echo "if hasattr($$module, \"commands\"):"; \
636
	  echo "  commands = $$module.commands"; \
637
	  echo; \
638
	  echo 'if __name__ == "__main__":'; \
639
	  echo "  sys.exit($$module.Main())"; \
640
	} > $@
641
	chmod u+x $@
642

  
608 643
# We need to create symlinks because "make distcheck" will not install Python
609 644
# files when building.
610 645
stamp-srclinks: Makefile stamp-directories
b/lib/client/__init__.py
1
#
2
#
3

  
4
# Copyright (C) 2010 Google Inc.
5
#
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
# 02110-1301, USA.
20

  
21

  
22
"""Empty file for package definition.
23

  
24
"""

Also available in: Unified diff