Revision d0d7d7cf lib/tools/burnin.py

b/lib/tools/burnin.py
1053 1053

  
1054 1054
    """
1055 1055

  
1056
    opts = self.opts
1057

  
1058 1056
    Log("Testing global parameters")
1059 1057

  
1060 1058
    if (len(self.nodes) == 1 and
1061
        opts.disk_template not in _SINGLE_NODE_DISK_TEMPLATES):
1059
        self.opts.disk_template not in _SINGLE_NODE_DISK_TEMPLATES):
1062 1060
      Err("When one node is available/selected the disk template must"
1063 1061
          " be one of %s" % utils.CommaJoin(_SINGLE_NODE_DISK_TEMPLATES))
1064 1062

  
1065
    if opts.do_confd_tests and not constants.ENABLE_CONFD:
1063
    if self.opts.do_confd_tests and not constants.ENABLE_CONFD:
1066 1064
      Err("You selected confd tests but confd was disabled at configure time")
1067 1065

  
1068 1066
    has_err = True
......
1072 1070
      if self.bep[constants.BE_MINMEM] < self.bep[constants.BE_MAXMEM]:
1073 1071
        self.BurnModifyRuntimeMemory()
1074 1072

  
1075
      if opts.do_replace1 and opts.disk_template in constants.DTS_INT_MIRROR:
1073
      if self.opts.do_replace1 and \
1074
           self.opts.disk_template in constants.DTS_INT_MIRROR:
1076 1075
        self.BurnReplaceDisks1D8()
1077
      if (opts.do_replace2 and len(self.nodes) > 2 and
1078
          opts.disk_template in constants.DTS_INT_MIRROR):
1076
      if (self.opts.do_replace2 and len(self.nodes) > 2 and
1077
          self.opts.disk_template in constants.DTS_INT_MIRROR):
1079 1078
        self.BurnReplaceDisks2()
1080 1079

  
1081
      if (opts.disk_template in constants.DTS_GROWABLE and
1080
      if (self.opts.disk_template in constants.DTS_GROWABLE and
1082 1081
          compat.any(n > 0 for n in self.disk_growth)):
1083 1082
        self.BurnGrowDisks()
1084 1083

  
1085
      if opts.do_failover and opts.disk_template in constants.DTS_MIRRORED:
1084
      if self.opts.do_failover and \
1085
           self.opts.disk_template in constants.DTS_MIRRORED:
1086 1086
        self.BurnFailover()
1087 1087

  
1088
      if opts.do_migrate:
1089
        if opts.disk_template not in constants.DTS_MIRRORED:
1088
      if self.opts.do_migrate:
1089
        if self.opts.disk_template not in constants.DTS_MIRRORED:
1090 1090
          Log("Skipping migration (disk template %s does not support it)",
1091
              opts.disk_template)
1091
              self.opts.disk_template)
1092 1092
        elif not self.hv_can_migrate:
1093 1093
          Log("Skipping migration (hypervisor %s does not support it)",
1094 1094
              self.hypervisor)
1095 1095
        else:
1096 1096
          self.BurnMigrate()
1097 1097

  
1098
      if (opts.do_move and len(self.nodes) > 1 and
1099
          opts.disk_template in [constants.DT_PLAIN, constants.DT_FILE]):
1098
      if (self.opts.do_move and len(self.nodes) > 1 and
1099
          self.opts.disk_template in [constants.DT_PLAIN, constants.DT_FILE]):
1100 1100
        self.BurnMove()
1101 1101

  
1102
      if (opts.do_importexport and
1103
          opts.disk_template in _IMPEXP_DISK_TEMPLATES):
1102
      if (self.opts.do_importexport and
1103
          self.opts.disk_template in _IMPEXP_DISK_TEMPLATES):
1104 1104
        self.BurnImportExport()
1105 1105

  
1106
      if opts.do_reinstall:
1106
      if self.opts.do_reinstall:
1107 1107
        self.BurnReinstall()
1108 1108

  
1109
      if opts.do_reboot:
1109
      if self.opts.do_reboot:
1110 1110
        self.BurnReboot()
1111 1111

  
1112
      if opts.do_renamesame:
1112
      if self.opts.do_renamesame:
1113 1113
        self.BurnRenameSame()
1114 1114

  
1115
      if opts.do_addremove_disks:
1115
      if self.opts.do_addremove_disks:
1116 1116
        self.BurnAddRemoveDisks()
1117 1117

  
1118 1118
      default_nic_mode = self.cluster_default_nicparams[constants.NIC_MODE]
1119 1119
      # Don't add/remove nics in routed mode, as we would need an ip to add
1120 1120
      # them with
1121
      if opts.do_addremove_nics:
1121
      if self.opts.do_addremove_nics:
1122 1122
        if default_nic_mode == constants.NIC_MODE_BRIDGED:
1123 1123
          self.BurnAddRemoveNICs()
1124 1124
        else:
1125 1125
          Log("Skipping nic add/remove as the cluster is not in bridged mode")
1126 1126

  
1127
      if opts.do_activate_disks:
1127
      if self.opts.do_activate_disks:
1128 1128
        self.BurnActivateDisks()
1129 1129

  
1130
      if opts.rename:
1130
      if self.opts.rename:
1131 1131
        self.BurnRename()
1132 1132

  
1133
      if opts.do_confd_tests:
1133
      if self.opts.do_confd_tests:
1134 1134
        self.BurnConfd()
1135 1135

  
1136
      if opts.do_startstop:
1136
      if self.opts.do_startstop:
1137 1137
        self.BurnStopStart()
1138 1138

  
1139 1139
      has_err = False

Also available in: Unified diff