DiskParams was used for the cluster/group disk parameters type. This patch renames it to GroupDiskParams and uses the DiskParams type for the parameters of one single Disk object.
Signed-off-by: Ilias Tsitsimpis <[email protected]> --- src/Ganeti/Config.hs | 2 +- src/Ganeti/Objects.hs | 13 ++++++++----- src/Ganeti/OpCodes.hs | 6 +++--- src/Ganeti/OpParams.hs | 6 +++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Ganeti/Config.hs b/src/Ganeti/Config.hs index f6243f7..3f76565 100644 --- a/src/Ganeti/Config.hs +++ b/src/Ganeti/Config.hs @@ -250,7 +250,7 @@ getGroupIpolicy cfg ng = fillIPolicy (clusterIpolicy $ configCluster cfg) (groupIpolicy ng) -- | Computes a group\'s (merged) disk params. -getGroupDiskParams :: ConfigData -> NodeGroup -> DiskParams +getGroupDiskParams :: ConfigData -> NodeGroup -> GroupDiskParams getGroupDiskParams cfg ng = GenericContainer $ fillDict (fromContainer . clusterDiskparams $ configCluster cfg) diff --git a/src/Ganeti/Objects.hs b/src/Ganeti/Objects.hs index c022d15..99c2a19 100644 --- a/src/Ganeti/Objects.hs +++ b/src/Ganeti/Objects.hs @@ -61,7 +61,7 @@ module Ganeti.Objects , FilledIPolicy(..) , PartialIPolicy(..) , fillIPolicy - , DiskParams + , GroupDiskParams , NodeGroup(..) , IpFamily(..) , ipFamilyToRaw @@ -274,6 +274,9 @@ instance UuidObject PartialNic where devType :: String devType = "dev_type" +-- | The disk parameters type. +type DiskParams = Container JSValue + -- | The disk configuration type. This includes the disk type itself, -- for a more complete consistency. Note that since in the Python -- code-base there's no authoritative place where we document the @@ -593,8 +596,8 @@ instance TagsObject Node where -- * NodeGroup definitions --- | The disk parameters type. -type DiskParams = Container (Container JSValue) +-- | The cluster/group disk parameters type. +type GroupDiskParams = Container DiskParams -- | A mapping from network UUIDs to nic params of the networks. type Networks = Container PartialNicParams @@ -605,7 +608,7 @@ $(buildObject "NodeGroup" "group" $ , simpleField "ndparams" [t| PartialNDParams |] , simpleField "alloc_policy" [t| AllocPolicy |] , simpleField "ipolicy" [t| PartialIPolicy |] - , simpleField "diskparams" [t| DiskParams |] + , simpleField "diskparams" [t| GroupDiskParams |] , simpleField "networks" [t| Networks |] ] ++ timeStampFields @@ -702,7 +705,7 @@ $(buildObject "Cluster" "cluster" $ , simpleField "osparams_private_cluster" [t| ClusterOsParamsPrivate |] , simpleField "nicparams" [t| ClusterNicParams |] , simpleField "ndparams" [t| FilledNDParams |] - , simpleField "diskparams" [t| DiskParams |] + , simpleField "diskparams" [t| GroupDiskParams |] , simpleField "candidate_pool_size" [t| Int |] , simpleField "modify_etc_hosts" [t| Bool |] , simpleField "modify_ssh_setup" [t| Bool |] diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs index 0cb840c..f0f4878 100644 --- a/src/Ganeti/OpCodes.hs +++ b/src/Ganeti/OpCodes.hs @@ -213,7 +213,7 @@ $(genOpCode "OpCode" , pOsHvp , pClusterOsParams , pClusterOsParamsPrivate - , pDiskParams + , pGroupDiskParams , pCandidatePoolSize , pMaxRunningJobs , pUidPool @@ -691,7 +691,7 @@ $(genOpCode "OpCode" [ pGroupName , pNodeGroupAllocPolicy , pGroupNodeParams - , pDiskParams + , pGroupDiskParams , pHvState , pDiskState , withDoc "Group-wide ipolicy specs" pIpolicy @@ -712,7 +712,7 @@ $(genOpCode "OpCode" [ pGroupName , pNodeGroupAllocPolicy , pGroupNodeParams - , pDiskParams + , pGroupDiskParams , pHvState , pDiskState , withDoc "Group-wide ipolicy specs" pIpolicy diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs index 40527c7..9202114 100644 --- a/src/Ganeti/OpParams.hs +++ b/src/Ganeti/OpParams.hs @@ -94,7 +94,7 @@ module Ganeti.OpParams , pSkipChecks , pIgnoreErrors , pOptGroupName - , pDiskParams + , pGroupDiskParams , pHvState , pDiskState , pIgnoreIpolicy @@ -651,8 +651,8 @@ pClusterOsParamsPrivate = simpleField "osparams_private_cluster" [t| GenericContainer String (JSObject (Private JSValue)) |] -pDiskParams :: Field -pDiskParams = +pGroupDiskParams :: Field +pGroupDiskParams = withDoc "Disk templates' parameter defaults" . optionalField $ simpleField "diskparams" -- 2.0.0.rc0
