Revision ecb215b5 lib/cmdlib.py

b/lib/cmdlib.py
207 207
                                            difference(all_fields)))
208 208

  
209 209

  
210
def _BuildInstanceHookEnv(name, primary_node, secondary_nodes, os, status,
210
def _BuildInstanceHookEnv(name, primary_node, secondary_nodes, os_type, status,
211 211
                          memory, vcpus, nics):
212
  """
212
  """Builds instance related env variables for hooks from single variables.
213

  
214
  Args:
215
    secondary_nodes: List of secondary nodes as strings
213 216
  """
214 217
  env = {
215 218
    "INSTANCE_NAME": name,
216 219
    "INSTANCE_PRIMARY": primary_node,
217 220
    "INSTANCE_SECONDARIES": " ".join(secondary_nodes),
218
    "INSTANCE_OS": os,
221
    "INSTANCE_OS_TYPE": os_type,
219 222
    "INSTANCE_STATUS": status,
220 223
    "INSTANCE_MEMORY": memory,
221 224
    "INSTANCE_VCPUS": vcpus,
......
237 240

  
238 241

  
239 242
def _BuildInstanceHookEnvByObject(instance, override=None):
243
  """Builds instance related env variables for hooks from an object.
244

  
245
  Args:
246
    instance: objects.Instance object of instance
247
    override: dict of values to override
248
  """
240 249
  args = {
241 250
    'name': instance.name,
242 251
    'primary_node': instance.primary_node,
243 252
    'secondary_nodes': instance.secondary_nodes,
244
    'os': instance.os,
253
    'os_type': instance.os,
245 254
    'status': instance.os,
246 255
    'memory': instance.memory,
247 256
    'vcpus': instance.vcpus,
......
2456 2465
      primary_node=self.op.pnode,
2457 2466
      secondary_nodes=self.secondaries,
2458 2467
      status=self.instance_status,
2459
      os=self.op.os_type,
2468
      os_type=self.op.os_type,
2460 2469
      memory=self.op.mem_size,
2461 2470
      vcpus=self.op.vcpus,
2462 2471
      nics=[(self.inst_ip, self.op.bridge)],
......
3292 3301
          raise errors.OpPrereqError, ("Invalid IP address '%s'." % self.ip)
3293 3302
    else:
3294 3303
      self.do_ip = False
3304
    self.do_bridge = (self.bridge is not None)
3295 3305

  
3296 3306
    instance = self.cfg.GetInstanceInfo(
3297 3307
      self.cfg.ExpandInstanceName(self.op.instance_name))

Also available in: Unified diff