Commit 7b3a8fb5 authored by Iustin Pop's avatar Iustin Pop
Browse files

Small random fixes

Indentation in bootstrap was wrong and some names in cmdlib.py were not
right.

Reviewed-by: imsnah
parent 4b2f38dd
......@@ -241,37 +241,37 @@ def InitCluster(cluster_name, hypervisor_type, mac_prefix, def_bridge,
def InitConfig(version, cluster_config, master_node_config,
cfg_file=constants.CLUSTER_CONF_FILE):
"""Create the initial cluster configuration.
It will contain the current node, which will also be the master
node, and no instances.
@type version: int
@param version: Configuration version
@type cluster_config: objects.Cluster
@param cluster_config: Cluster configuration
@type master_node_config: objects.Node
@param master_node_config: Master node configuration
@type file_name: string
@param file_name: Configuration file path
@rtype: ssconf.SimpleConfigWriter
@returns: Initialized config instance
"""
nodes = {
master_node_config.name: master_node_config,
}
config_data = objects.ConfigData(version=version,
cluster=cluster_config,
nodes=nodes,
instances={},
serial_no=1)
cfg = ssconf.SimpleConfigWriter.FromDict(config_data.ToDict(), cfg_file)
cfg.Save()
return cfg
"""Create the initial cluster configuration.
It will contain the current node, which will also be the master
node, and no instances.
@type version: int
@param version: Configuration version
@type cluster_config: objects.Cluster
@param cluster_config: Cluster configuration
@type master_node_config: objects.Node
@param master_node_config: Master node configuration
@type file_name: string
@param file_name: Configuration file path
@rtype: ssconf.SimpleConfigWriter
@returns: Initialized config instance
"""
nodes = {
master_node_config.name: master_node_config,
}
config_data = objects.ConfigData(version=version,
cluster=cluster_config,
nodes=nodes,
instances={},
serial_no=1)
cfg = ssconf.SimpleConfigWriter.FromDict(config_data.ToDict(), cfg_file)
cfg.Save()
return cfg
def FinalizeClusterDestroy(master):
......
......@@ -1465,7 +1465,7 @@ class LUQueryNodes(NoHooksLU):
nodenames = self.wanted
missing = set(nodenames).difference(all_info.keys())
if missing:
raise self.OpExecError(
raise errors.OpExecError(
"Some nodes were removed before retrieving their data: %s" % missing)
else:
nodenames = all_info.keys()
......@@ -2649,7 +2649,7 @@ class LUQueryInstances(NoHooksLU):
instance_names = self.wanted
missing = set(instance_names).difference(all_info.keys())
if missing:
raise self.OpExecError(
raise errors.OpExecError(
"Some instances were removed before retrieving their data: %s"
% missing)
else:
......@@ -3397,7 +3397,7 @@ class LUCreateInstance(LogicalUnit):
if self.op.ip_check:
if utils.TcpPing(self.check_ip, constants.DEFAULT_NODED_PORT):
raise errors.OpPrereqError("IP %s of instance %s already in use" %
(self.check_ip, instance_name))
(self.check_ip, self.op.instance_name))
# bridge verification
bridge = getattr(self.op, "bridge", None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment