LGTM (squashing into the previous patch)
Thanks, Guido On Mon, Feb 11, 2013 at 1:42 PM, Dimitris Aragiorgis <[email protected]> wrote: > See corresponding patch for python. > > Signed-off-by: Dimitris Aragiorgis <[email protected]> > --- > src/Ganeti/Objects.hs | 2 -- > src/Ganeti/OpCodes.hs | 2 -- > src/Ganeti/OpParams.hs | 5 ----- > src/Ganeti/Types.hs | 9 --------- > test/hs/Test/Ganeti/Network.hs | 2 -- > test/hs/Test/Ganeti/Objects.hs | 6 ------ > test/hs/Test/Ganeti/Types.hs | 15 --------------- > 7 files changed, 41 deletions(-) > > diff --git a/src/Ganeti/Objects.hs b/src/Ganeti/Objects.hs > index b0fd163..d3f13df 100644 > --- a/src/Ganeti/Objects.hs > +++ b/src/Ganeti/Objects.hs > @@ -173,8 +173,6 @@ roleDescription NRMaster = "master" > $(buildObject "Network" "network" $ > [ simpleField "name" [t| NonEmptyString |] > , optionalField $ > - simpleField "network_type" [t| NetworkType |] > - , optionalField $ > simpleField "mac_prefix" [t| String |] > , optionalField $ > simpleField "family" [t| Int |] > diff --git a/src/Ganeti/OpCodes.hs b/src/Ganeti/OpCodes.hs > index ec9a34f..7e931b8 100644 > --- a/src/Ganeti/OpCodes.hs > +++ b/src/Ganeti/OpCodes.hs > @@ -501,7 +501,6 @@ $(genOpCode "OpCode" > ]) > , ("OpNetworkAdd", > [ pNetworkName > - , pNetworkType > , pNetworkAddress4 > , pNetworkGateway4 > , pNetworkAddress6 > @@ -517,7 +516,6 @@ $(genOpCode "OpCode" > ]) > , ("OpNetworkSetParams", > [ pNetworkName > - , pNetworkType > , pNetworkGateway4 > , pNetworkAddress6 > , pNetworkGateway6 > diff --git a/src/Ganeti/OpParams.hs b/src/Ganeti/OpParams.hs > index b247f00..8e91b8f 100644 > --- a/src/Ganeti/OpParams.hs > +++ b/src/Ganeti/OpParams.hs > @@ -222,7 +222,6 @@ module Ganeti.OpParams > , pTestDummyFail > , pTestDummySubmitJobs > , pNetworkName > - , pNetworkType > , pNetworkAddress4 > , pNetworkGateway4 > , pNetworkAddress6 > @@ -1358,10 +1357,6 @@ pTestDummySubmitJobs = > pNetworkName :: Field > pNetworkName = simpleField "network_name" [t| NonEmptyString |] > > --- | Network type field. > -pNetworkType :: Field > -pNetworkType = optionalField $ simpleField "network_type" [t| NetworkType |] > - > -- | Network address (IPv4 subnet). FIXME: no real type for this. > pNetworkAddress4 :: Field > pNetworkAddress4 = > diff --git a/src/Ganeti/Types.hs b/src/Ganeti/Types.hs > index ae692f6..e6c9378 100644 > --- a/src/Ganeti/Types.hs > +++ b/src/Ganeti/Types.hs > @@ -70,8 +70,6 @@ module Ganeti.Types > , IAllocatorTestDir(..) > , IAllocatorMode(..) > , iAllocatorModeToRaw > - , NetworkType(..) > - , networkTypeToRaw > , NICMode(..) > , nICModeToRaw > , JobStatus(..) > @@ -359,13 +357,6 @@ $(THH.declareSADT "IAllocatorMode" > ]) > $(THH.makeJSONInstance ''IAllocatorMode) > > --- | Network type. > -$(THH.declareSADT "NetworkType" > - [ ("PrivateNetwork", 'C.networkTypePrivate) > - , ("PublicNetwork", 'C.networkTypePublic) > - ]) > -$(THH.makeJSONInstance ''NetworkType) > - > -- | Netork mode. > $(THH.declareSADT "NICMode" > [ ("NMBridged", 'C.nicModeBridged) > diff --git a/test/hs/Test/Ganeti/Network.hs b/test/hs/Test/Ganeti/Network.hs > index 4867830..57793ca 100644 > --- a/test/hs/Test/Ganeti/Network.hs > +++ b/test/hs/Test/Ganeti/Network.hs > @@ -4,7 +4,6 @@ > module Test.Ganeti.Network > ( testNetwork > , genBitStringMaxLen > - , genNetworkType > ) where > > import Test.QuickCheck > @@ -14,7 +13,6 @@ import Ganeti.Objects as Objects > > import Test.Ganeti.Objects > ( genBitStringMaxLen > - , genNetworkType > , genValidNetwork ) > import Test.Ganeti.TestHelper > import Test.Ganeti.TestCommon > diff --git a/test/hs/Test/Ganeti/Objects.hs b/test/hs/Test/Ganeti/Objects.hs > index a4fa648..def5263 100644 > --- a/test/hs/Test/Ganeti/Objects.hs > +++ b/test/hs/Test/Ganeti/Objects.hs > @@ -31,7 +31,6 @@ module Test.Ganeti.Objects > , Node(..) > , genEmptyCluster > , genValidNetwork > - , genNetworkType > , genBitStringMaxLen > ) where > > @@ -169,7 +168,6 @@ genValidNetwork = do > -- generate netmask for the IPv4 network > netmask <- choose (24::Int, 30) > name <- genName >>= mkNonEmpty > - network_type <- genMaybe genNetworkType > mac_prefix <- genMaybe genName > net_family <- arbitrary > net <- genIp4NetWithNetmask netmask > @@ -183,10 +181,6 @@ genValidNetwork = do > gateway6 size res ext_res 0 Set.empty > return n > > --- | Generates an arbitrary network type. > -genNetworkType :: Gen NetworkType > -genNetworkType = elements [ PrivateNetwork, PublicNetwork ] > - > -- | Generate an arbitrary string consisting of '0' and '1' of the given > length. > genBitString :: Int -> Gen String > genBitString len = vectorOf len (elements "01") > diff --git a/test/hs/Test/Ganeti/Types.hs b/test/hs/Test/Ganeti/Types.hs > index 7526e01..6f84782 100644 > --- a/test/hs/Test/Ganeti/Types.hs > +++ b/test/hs/Test/Ganeti/Types.hs > @@ -112,8 +112,6 @@ $(genArbitrary ''IAllocatorTestDir) > > $(genArbitrary ''IAllocatorMode) > > -$(genArbitrary ''NetworkType) > - > $(genArbitrary ''NICMode) > > $(genArbitrary ''JobStatus) > @@ -287,17 +285,6 @@ case_IAllocatorMode_pyequiv = do > all_hs_codes = sort $ map Types.iAllocatorModeToRaw > [minBound..maxBound] > assertEqual "for IAllocatorMode equivalence" all_py_codes all_hs_codes > > --- | Test 'NetworkType' serialisation. > -prop_NetworkType_serialisation :: NetworkType -> Property > -prop_NetworkType_serialisation = testSerialisation > - > --- | Tests equivalence with Python, based on Constants.hs code. > -case_NetworkType_pyequiv :: Assertion > -case_NetworkType_pyequiv = do > - let all_py_codes = sort C.networkValidTypes > - all_hs_codes = sort $ map Types.networkTypeToRaw [minBound..maxBound] > - assertEqual "for NetworkType equivalence" all_py_codes all_hs_codes > - > -- | Test 'NICMode' serialisation. > prop_NICMode_serialisation :: NICMode -> Property > prop_NICMode_serialisation = testSerialisation > @@ -417,8 +404,6 @@ testSuite "Types" > , 'prop_IAllocatorTestDir_serialisation > , 'prop_IAllocatorMode_serialisation > , 'case_IAllocatorMode_pyequiv > - , 'prop_NetworkType_serialisation > - , 'case_NetworkType_pyequiv > , 'prop_NICMode_serialisation > , 'prop_OpStatus_serialization > , 'prop_JobStatus_serialization > -- > 1.7.10.4 > -- Guido Trotter Ganeti engineering Google Germany
