Revision 17b0b812

b/lib/backend.py
666 666
    result[constants.NV_MASTERIP] = netutils.TcpPing(master_ip, port,
667 667
                                                  source=source)
668 668

  
669
  if constants.NV_USERSCRIPTS in what:
670
    result[constants.NV_USERSCRIPTS] = \
671
      [script for script in what[constants.NV_USERSCRIPTS]
672
       if not (os.path.exists(script) and os.access(script, os.X_OK))]
673

  
669 674
  if constants.NV_OOB_PATHS in what:
670 675
    result[constants.NV_OOB_PATHS] = tmp = []
671 676
    for path in what[constants.NV_OOB_PATHS]:
b/lib/cmdlib.py
1941 1941
      _ErrorIf(bool(missing), constants.CV_ENODENET, node,
1942 1942
               "missing bridges: %s" % utils.CommaJoin(sorted(missing)))
1943 1943

  
1944
  def _VerifyNodeUserScripts(self, ninfo, nresult):
1945
    """Check the results of user scripts presence and executability on the node
1946

  
1947
    @type ninfo: L{objects.Node}
1948
    @param ninfo: the node to check
1949
    @param nresult: the remote results for the node
1950

  
1951
    """
1952
    node = ninfo.name
1953

  
1954
    test = not constants.NV_USERSCRIPTS in nresult
1955
    self._ErrorIf(test, constants.CV_ENODEUSERSCRIPTS, node,
1956
                  "did not return user scripts information")
1957

  
1958
    broken_scripts = nresult.get(constants.NV_USERSCRIPTS, None)
1959
    if not test:
1960
      self._ErrorIf(broken_scripts, constants.CV_ENODEUSERSCRIPTS, node,
1961
                    "user scripts not present or not executable: %s" %
1962
                    utils.CommaJoin(sorted(broken_scripts)))
1963

  
1944 1964
  def _VerifyNodeNetwork(self, ninfo, nresult):
1945 1965
    """Check the node network connectivity results.
1946 1966

  
......
2649 2669

  
2650 2670
    feedback_fn("* Gathering data (%d nodes)" % len(self.my_node_names))
2651 2671

  
2672
    user_scripts = []
2673
    if self.cfg.GetUseExternalMipScript():
2674
      user_scripts.append(constants.EXTERNAL_MASTER_SETUP_SCRIPT)
2675

  
2652 2676
    node_verify_param = {
2653 2677
      constants.NV_FILELIST:
2654 2678
        utils.UniqueSequence(filename
......
2671 2695
      constants.NV_MASTERIP: (master_node, master_ip),
2672 2696
      constants.NV_OSLIST: None,
2673 2697
      constants.NV_VMNODES: self.cfg.GetNonVmCapableNodeList(),
2698
      constants.NV_USERSCRIPTS: user_scripts,
2674 2699
      }
2675 2700

  
2676 2701
    if vg_name is not None:
......
2829 2854
      nimg.call_ok = self._VerifyNode(node_i, nresult)
2830 2855
      self._VerifyNodeTime(node_i, nresult, nvinfo_starttime, nvinfo_endtime)
2831 2856
      self._VerifyNodeNetwork(node_i, nresult)
2857
      self._VerifyNodeUserScripts(node_i, nresult)
2832 2858
      self._VerifyOob(node_i, nresult)
2833 2859

  
2834 2860
      if nimg.vm_capable:
......
3798 3824

  
3799 3825
  # Files which should only be on master candidates
3800 3826
  files_mc = set()
3827

  
3801 3828
  if not redist:
3802 3829
    files_mc.add(constants.CLUSTER_CONF_FILE)
3803 3830

  
3831
    # FIXME: this should also be replicated but Ganeti doesn't support files_mc
3832
    # replication
3833
    files_mc.add(constants.DEFAULT_MASTER_SETUP_SCRIPT)
3834

  
3804 3835
  # Files which should only be on VM-capable nodes
3805 3836
  files_vm = set(filename
3806 3837
    for hv_name in cluster.enabled_hypervisors
b/lib/constants.py
1192 1192
  (CV_TNODE, "ENODETIME", "Node returned invalid time")
1193 1193
CV_ENODEOOBPATH = \
1194 1194
  (CV_TNODE, "ENODEOOBPATH", "Invalid Out Of Band path")
1195
CV_ENODEUSERSCRIPTS = \
1196
  (CV_TNODE, "ENODEUSERSCRIPTS", "User scripts not present or not executable")
1195 1197

  
1196 1198
CV_ALL_ECODES = frozenset([
1197 1199
  CV_ECLUSTERCFG,
......
1223 1225
  CV_ENODESETUP,
1224 1226
  CV_ENODETIME,
1225 1227
  CV_ENODEOOBPATH,
1228
  CV_ENODEUSERSCRIPTS,
1226 1229
  ])
1227 1230

  
1228 1231
CV_ALL_ECODES_STRINGS = frozenset(estr for (_, estr, _) in CV_ALL_ECODES)
......
1248 1251
NV_VMNODES = "vmnodes"
1249 1252
NV_OOB_PATHS = "oob-paths"
1250 1253
NV_BRIDGES = "bridges"
1254
NV_USERSCRIPTS = "user-scripts"
1251 1255

  
1252 1256
# Instance status
1253 1257
INSTST_RUNNING = "running"

Also available in: Unified diff