Revision 7a70541e

b/lib/client/gnt_instance.py
1323 1323
        else:
1324 1324
          action = constants.DDM_MODIFY
1325 1325

  
1326
      elif add is _MISSING and remove is _MISSING:
1327
        action = constants.DDM_MODIFY
1326 1328
      else:
1327
        if add is _MISSING and remove is _MISSING:
1328
          action = constants.DDM_MODIFY
1329
        else:
1330
          raise errors.OpPrereqError("Cannot modify and add/remove at the"
1331
                                     " same time", errors.ECODE_INVAL)
1329
        raise errors.OpPrereqError("Cannot modify and add/remove at the"
1330
                                   " same time", errors.ECODE_INVAL)
1332 1331

  
1333 1332
      assert not (constants.DDMS_VALUES_WITH_MODIFY & set(params.keys()))
1334 1333

  
b/test/ganeti.client.gnt_instance_unittest.py
149 149
        ]), [
150 150
        (action, -1, {}),
151 151
        ])
152
      self.assertRaises(errors.OpPrereqError, fn, [
153
        (0, {
154
          action: True,
155
          constants.DDM_MODIFY: True,
156
          }),
157
        ])
152 158

  
153 159
    self.assertEqual(fn([
154 160
      (constants.DDM_ADD, {
......
190 196
      (constants.DDM_REMOVE, -1, {}),
191 197
      ])
192 198

  
199
    self.assertEqual(fn([
200
      (-1, {
201
        constants.DDM_MODIFY: True,
202
        constants.IDISK_SIZE: 1024,
203
        }),
204
      ]), [
205
      (constants.DDM_MODIFY, -1, {
206
        constants.IDISK_SIZE: 1024,
207
        }),
208
      ])
209

  
193 210

  
194 211
class TestParseDiskSizes(unittest.TestCase):
195 212
  def test(self):

Also available in: Unified diff