Revision 5cbf7832

b/lib/cli.py
464 464
    raise errors.ProgrammerError("tag_type not passed to _ExtractTagsObject")
465 465
  kind = opts.tag_type
466 466
  if kind == constants.TAG_CLUSTER:
467
    retval = kind, None
467
    retval = kind, ""
468 468
  elif kind in (constants.TAG_NODEGROUP,
469 469
                constants.TAG_NODE,
470 470
                constants.TAG_NETWORK,
b/lib/cmdlib/instance_operation.py
184 184

  
185 185
    """
186 186
    env = BuildInstanceHookEnvByObject(self, self.instance)
187
    env["SHUTDOWN_TIMEOUT"] = self.op.shutdown_timeout
187
    env["TIMEOUT"] = self.op.timeout
188 188
    return env
189 189

  
190 190
  def BuildHooksNodes(self):
......
233 233
      result = self.rpc.call_instance_shutdown(
234 234
        self.instance.primary_node,
235 235
        self.instance,
236
        self.op.shutdown_timeout, self.op.reason)
236
        self.op.timeout, self.op.reason)
237 237
      msg = result.fail_msg
238 238
      if msg:
239 239
        self.LogWarning("Could not shutdown instance: %s", msg)
b/src/Ganeti/HTools/Program/Harep.hs
268 268
  when (isJust arData) $ do
269 269
    let tag = arTag $ fromJust arData
270 270
    putStrLn (">>> Adding the following tag to " ++ iname ++ ":\n" ++ show tag)
271
    tagName <- mkNonEmpty iname
272
    execJobsWaitOk' [OpTagsSet TagKindInstance [tag] (Just tagName)]
271
    execJobsWaitOk' [OpTagsSet TagKindInstance [tag] (Just iname)]
273 272

  
274 273
  unless (null rmTags) $ do
275 274
    putStr (">>> Removing the following tags from " ++ iname ++ ":\n" ++
276 275
            unlines (map show rmTags))
277
    tagName <- mkNonEmpty iname
278
    execJobsWaitOk' [OpTagsDel TagKindInstance rmTags (Just tagName)]
276
    execJobsWaitOk' [OpTagsDel TagKindInstance rmTags (Just iname)]
279 277

  
280 278
  return instData { tagsToRemove = [] }
281 279

  
b/src/Ganeti/OpCodes.hs
530 530
     , pInstanceUuid
531 531
     , pForce
532 532
     , pIgnoreOfflineNodes
533
     , pShutdownTimeout
533
     , pShutdownTimeout'
534 534
     , pNoRemember
535 535
     ],
536 536
     "instance_name")
......
856 856
     ],
857 857
     "duration")
858 858
  , ("OpTestAllocator",
859
     [t| () |],
859
     [t| String |],
860 860
     OpDoc.opTestAllocator,
861 861
     [ pIAllocatorDirection
862 862
     , pIAllocatorMode
......
878 878
     ],
879 879
     "iallocator")
880 880
  , ("OpTestJqueue",
881
     [t| () |],
881
     [t| Bool |],
882 882
     OpDoc.opTestJqueue,
883 883
     [ pJQueueNotifyWaitLock
884 884
     , pJQueueNotifyExec
b/src/Ganeti/OpParams.hs
52 52
  , pTagsName
53 53
  , pOutputFields
54 54
  , pShutdownTimeout
55
  , pShutdownTimeout'
55 56
  , pShutdownInstance
56 57
  , pForce
57 58
  , pIgnoreOfflineNodes
......
572 573
pEnabledHypervisors =
573 574
  withDoc "List of enabled hypervisors" .
574 575
  optionalField $
575
  simpleField "enabled_hypervisors" [t| Hypervisor |]
576
  simpleField "enabled_hypervisors" [t| [Hypervisor] |]
576 577

  
577 578
pClusterHvParams :: Field
578 579
pClusterHvParams =
......
616 617
pUidPool =
617 618
  withDoc "Set UID pool, must be list of lists describing UID ranges\
618 619
          \ (two items, start and end inclusive)" .
619
  optionalField $ simpleField "uid_pool" [t| [[(Int, Int)]] |]
620
  optionalField $ simpleField "uid_pool" [t| [(Int, Int)] |]
620 621

  
621 622
pAddUids :: Field
622 623
pAddUids =
623 624
  withDoc "Extend UID pool, must be list of lists describing UID\
624 625
          \ ranges (two items, start and end inclusive)" .
625
  optionalField $ simpleField "add_uids" [t| [[(Int, Int)]] |]
626
  optionalField $ simpleField "add_uids" [t| [(Int, Int)] |]
626 627

  
627 628
pRemoveUids :: Field
628 629
pRemoveUids =
629 630
  withDoc "Shrink UID pool, must be list of lists describing UID\
630 631
          \ ranges (two items, start and end inclusive) to be removed" .
631
  optionalField $ simpleField "remove_uids" [t| [[(Int, Int)]] |]
632
  optionalField $ simpleField "remove_uids" [t| [(Int, Int)] |]
632 633

  
633 634
pMaintainNodeHealth :: Field
634 635
pMaintainNodeHealth =
......
704 705
pEnabledDiskTemplates =
705 706
  withDoc "List of enabled disk templates" .
706 707
  optionalField $
707
  simpleField "enabled_disk_templates" [t| DiskTemplate |]
708
  simpleField "enabled_disk_templates" [t| [DiskTemplate] |]
708 709

  
709 710
pQueryWhat :: Field
710 711
pQueryWhat =
......
796 797

  
797 798
pPrimaryIp :: Field
798 799
pPrimaryIp =
799
  withDoc "Primary IP address" $
800
  withDoc "Primary IP address" .
801
  optionalField $
800 802
  simpleField "primary_ip" [t| NonEmptyString |]
801 803

  
802 804
pSecondaryIp :: Field
......
979 981

  
980 982
pDiskTemplate :: Field
981 983
pDiskTemplate =
982
  withDoc "List of instance disks" $
984
  withDoc "Disk template" $
983 985
  simpleField "disk_template" [t| DiskTemplate |]
984 986

  
985 987
pFileDriver :: Field
......
1151 1153
  defaultField [| forceNonNeg C.defaultShutdownTimeout |] $
1152 1154
  simpleField "shutdown_timeout" [t| NonNegative Int |]
1153 1155

  
1156
-- | Another name for the shutdown timeout, because we like to be
1157
-- inconsistent.
1158
pShutdownTimeout' :: Field
1159
pShutdownTimeout' =
1160
  withDoc "How long to wait for instance to shut down" .
1161
  renameField "InstShutdownTimeout" .
1162
  defaultField [| forceNonNeg C.defaultShutdownTimeout |] $
1163
  simpleField "timeout" [t| NonNegative Int |]
1164

  
1154 1165
pIgnoreFailures :: Field
1155 1166
pIgnoreFailures =
1156 1167
  withDoc "Whether to ignore failures during removal" $
......
1373 1384
pTagsName =
1374 1385
  withDoc "Name of object" .
1375 1386
  renameField "TagsGetName" .
1376
  optionalField $ simpleField "name" [t| NonEmptyString |]
1387
  optionalField $ simpleField "name" [t| String |]
1377 1388

  
1378 1389
pTagsList :: Field
1379 1390
pTagsList =
b/test/hs/Test/Ganeti/OpCodes.hs
197 197
        OpCodes.OpNodeRemove <$> genNodeNameNE <*> return Nothing
198 198
      "OP_NODE_ADD" ->
199 199
        OpCodes.OpNodeAdd <$> genNodeNameNE <*> emptyMUD <*> emptyMUD <*>
200
          genNameNE <*> genMaybe genNameNE <*> arbitrary <*>
200
          genMaybe genNameNE <*> genMaybe genNameNE <*> arbitrary <*>
201 201
          genMaybe genNameNE <*> arbitrary <*> arbitrary <*> emptyMUD
202 202
      "OP_NODE_QUERY" ->
203 203
        OpCodes.OpNodeQuery <$> genFieldsNE <*> genNamesNE <*> arbitrary
b/test/hs/Test/Ganeti/TestCommon.hs
328 328

  
329 329
-- | Generates a valid, arbitrary tag name with respect to the given
330 330
-- 'TagKind' for opcodes.
331
genOpCodesTagName :: TagKind -> Gen (Maybe NonEmptyString)
331
genOpCodesTagName :: TagKind -> Gen (Maybe String)
332 332
genOpCodesTagName TagKindCluster = return Nothing
333
genOpCodesTagName _ = Just <$> (mkNonEmpty =<< genFQDN)
333
genOpCodesTagName _ = Just <$> genFQDN
334 334

  
335 335
-- | Generates a valid, arbitrary tag name with respect to the given
336 336
-- 'TagKind' for Luxi.

Also available in: Unified diff