Author: Arnaud Fontaine <arnau@debian.org>
Forwarded: not-needed
Description: SlapOS Node subcommands are only available in slapos-node-unofficial
 The Debian package is split up into two packages, thus ``slapos node ...''
 subcommands are not available if slapos-node-unofficial is not installed.

--- a/slapos/entry.py
+++ b/slapos/entry.py
@@ -30,19 +30,26 @@
 import ConfigParser
 import os
 import sys
-from slapos.bang import main as bang
 from slapos.client import slapconsole as console
 from slapos.client import request as request
 from slapos.client import remove as remove
 from slapos.client import supply as supply
-from slapos.format import main as format
 from slapos.cache import cache_lookup
-from slapos.grid.slapgrid import runComputerPartition as instance
-from slapos.grid.slapgrid import runSoftwareRelease as software
-from slapos.grid.slapgrid import runUsageReport as report
-from slapos.grid.svcbackend import supervisord
-from slapos.grid.svcbackend import supervisorctl
-from slapos.register.register import main as register
+
+try:
+  from slapos.bang import main as bang
+  from slapos.format import main as format
+  from slapos.grid.slapgrid import runComputerPartition as instance
+  from slapos.grid.slapgrid import runSoftwareRelease as software
+  from slapos.grid.slapgrid import runUsageReport as report
+  from slapos.grid.svcbackend import supervisord
+  from slapos.grid.svcbackend import supervisorctl
+  from slapos.register.register import main as register
+except ImportError:
+  SLAPOS_CLIENT_ONLY = True
+else:
+  SLAPOS_CLIENT_ONLY = False
+
 from slapos.version import version
 
 # Note: this whole file is a hack. We should better try dedicated library
@@ -170,7 +177,7 @@
   module responsible of the operation.
   """
   # If "node" arg is the first: we strip it and set a switch
-  if len(sys.argv) > 1 and sys.argv[1] == "node":
+  if len(sys.argv) > 1 and sys.argv[1] == "node" and not SLAPOS_CLIENT_ONLY:
     sys.argv.pop(1)
     # Hackish way to show status if no argument is specified
     if len(sys.argv) is 1:
@@ -181,12 +188,24 @@
 
   usage = """SlapOS %s command line interface.
 For more informations, refer to SlapOS documentation.
+""" % version
 
+  if SLAPOS_CLIENT_ONLY:
+    usage += """
+*****IMPORTANT NOTE*****: "node" subcommands are not available because
+"slapos-node-unofficial" Debian package is not installed.
+"""
+
+  usage += """
 Client subcommands usage:
   slapos request <instance-name> <software-url> [--configuration arg1=value1 arg2=value2 ... argN=valueN]
   slapos supply <software-url> <node-id>
   slapos console
   slapos cache-lookup <software-url-or-md5>
+"""
+
+  if not SLAPOS_CLIENT_ONLY:
+    usage += """
 Node subcommands usage:
   slapos node
   slapos node register <node-id>
@@ -201,7 +220,7 @@
   slapos node status <process>
   slapos node supervisorctl
   slapos node supervisord
-""" % version
+"""
 
   # Parse arguments
   # XXX remove the "positional arguments" from help message
