Commit 5ce621ab authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Correct properties of the cluster's file storage dir



This patch does:
- Rename the haskell opcode parameter
  'pGlobalFileStorageDir' and 'pGlobalSharedfileStorageDir'
  to 'pClusterFileStorageDir' and
  'pClusterSharedfileStorageDir', respectively, because
  the old name was misleading.
- The two parameters are made optional strings instead of
  non-empty strings. This actually used to be like this
  before, but was accidentally overriden by the switch to
  opcode generation from haskell to python.
- The ClusterFileStorageDir parameter had to be renamed in
  Haskell to not clash with the FileStorageDir parameter
  of the OpInstanceCreate code.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 916c0e6f
......@@ -232,8 +232,8 @@ $(genOpCode "OpCode"
, pUseExternalMipScript
, pEnabledDiskTemplates
, pModifyEtcHosts
, pGlobalFileStorageDir
, pGlobalSharedFileStorageDir
, pClusterFileStorageDir
, pClusterSharedFileStorageDir
],
[])
, ("OpClusterRedistConf",
......
......@@ -100,8 +100,8 @@ module Ganeti.OpParams
, pOptDiskTemplate
, pFileDriver
, pFileStorageDir
, pGlobalFileStorageDir
, pGlobalSharedFileStorageDir
, pClusterFileStorageDir
, pClusterSharedFileStorageDir
, pVgName
, pEnabledHypervisors
, pHypervisor
......@@ -541,13 +541,17 @@ pDiskState =
withDoc "Set disk states" .
optionalField $ simpleField "disk_state" [t| JSObject JSValue |]
-- | Global directory for storing file-backed disks.
pGlobalFileStorageDir :: Field
pGlobalFileStorageDir = optionalNEStringField "file_storage_dir"
-- | Global directory for storing shared-file-backed disks.
pGlobalSharedFileStorageDir :: Field
pGlobalSharedFileStorageDir = optionalNEStringField "shared_file_storage_dir"
-- | Cluster-wide default directory for storing file-backed disks.
pClusterFileStorageDir :: Field
pClusterFileStorageDir =
renameField "ClusterFileStorageDir" $
optionalStringField "file_storage_dir"
-- | Cluster-wide default directory for storing shared-file-backed disks.
pClusterSharedFileStorageDir :: Field
pClusterSharedFileStorageDir =
renameField "ClusterSharedFileStorageDir" $
optionalStringField "shared_file_storage_dir"
-- | Volume group name.
pVgName :: Field
......
......@@ -177,8 +177,8 @@ instance Arbitrary OpCodes.OpCode where
emptyMUD <*> emptyMUD <*> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
genMaybe (genName >>= mkNonEmpty) <*>
genMaybe (genName >>= mkNonEmpty)
genMaybe genName <*>
genMaybe genName
"OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf
"OP_CLUSTER_ACTIVATE_MASTER_IP" ->
pure OpCodes.OpClusterActivateMasterIp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment