ganeti-local
10 years agoFix tests related to the physical_id field
Thomas Thrainer [Thu, 19 Sep 2013 12:42:20 +0000 (14:42 +0200)]
Fix tests related to the physical_id field

Remove all references to the physical_id field of disk objects in tests.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoRemove physical_id field from disk object
Thomas Thrainer [Thu, 19 Sep 2013 13:56:04 +0000 (15:56 +0200)]
Remove physical_id field from disk object

The 'physical_id' field of disk objects is no longer used, so remove it.
Also, all references are removed together with the code which made sure
that the physical_id is up to date when transmitted over RPC.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoReplace physical_id with dynamic_params
Thomas Thrainer [Thu, 19 Sep 2013 13:49:23 +0000 (15:49 +0200)]
Replace physical_id with dynamic_params

The disk field 'physical_id' has to be kept up to date whenever a disk
object is sent to a node via RPC. This is done with the SetDiskID method
manually, which is a source of bugs.

This patch replaces the use of 'physical_id' with a new field names
'dynamic_params'. The RPC code is adapted to update this field whenever
a disk object is sent to a node. Furthermore, this field is only ever
set on copies of disk objects which don't get written to the
configuration file. On the node side, the use of 'physical_id' is
removed and the new dynamic parameters are used now for the same
purpose.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoFix typo
Thomas Thrainer [Thu, 19 Sep 2013 13:32:28 +0000 (15:32 +0200)]
Fix typo

Fix typo in comment.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoHandle $(python_scripts) and tools/burnin as python scripts
Klaus Aehlig [Mon, 23 Sep 2013 14:47:29 +0000 (16:47 +0200)]
Handle $(python_scripts) and tools/burnin as python scripts

With the new private-module layout, python scripts using the
ganeti module must end up in $(versionedsharedir) in order
to see this private module.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoProvide PYTHONPATH to burnin
Klaus Aehlig [Mon, 23 Sep 2013 13:41:03 +0000 (15:41 +0200)]
Provide PYTHONPATH to burnin

One feature of the new private-module layout is that a python
script cannot simply 'import ganeti'. The reason is that the
interfaces to these modules are not stable and hence should not
be used outside Ganeti. However, this is what the burnin test
in the qa does. The good news is that we know that the burnin
script will always be from the same version of ganeti as the
one we're testing against; so we can simply provide the appropriate
PYTHONPATH.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoExport VERSIONEDSHAREDIR to _autoconf.py
Klaus Aehlig [Mon, 23 Sep 2013 13:33:50 +0000 (15:33 +0200)]
Export VERSIONEDSHAREDIR to _autoconf.py

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoFix 'AutoConf.hs.in' template substitution
Jose A. Lopes [Fri, 20 Sep 2013 12:43:35 +0000 (14:43 +0200)]
Fix 'AutoConf.hs.in' template substitution

Fix 'AutoConf.hs.in' template substitution, namely, change 'SOCAT' to
'SOCAT_PATH' to match the value used in the invocation of 'm4' in the
target 'src/AutoConf.hs' in 'Makefile.am'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAlso install the version-dependent links forcefully
Klaus Aehlig [Fri, 20 Sep 2013 12:10:44 +0000 (14:10 +0200)]
Also install the version-dependent links forcefully

In this way, with default configuration options, running
make install twice in a row succeeds. Fixes issue 567.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoHs2Py constants: update 'SF_*' references
Jose A. Lopes [Wed, 18 Sep 2013 16:36:25 +0000 (18:36 +0200)]
Hs2Py constants: update 'SF_*' references

Update references to storage field Python constants to fetch their
values from 'lib/_constants.py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add storage fields
Jose A. Lopes [Wed, 18 Sep 2013 11:18:24 +0000 (13:18 +0200)]
Hs2Py constants: add storage fields

Add storage fields constants to the Haskell to Python constant
generation.  These constants fetch their values from the Haskell data
type 'StorageField'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMove 'StorageField' to 'Ganeti.Types'
Jose A. Lopes [Wed, 18 Sep 2013 16:32:48 +0000 (18:32 +0200)]
Move 'StorageField' to 'Ganeti.Types'

Move 'StorageField' to 'Ganeti.Types' in order to break the
circularity of 'Ganeti.Rpc' and be able to generate constants from
this Haskell data type.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix 'TOOLSDIR' when passed to 'src/AutoConf.hs'
Jose A. Lopes [Fri, 20 Sep 2013 12:31:25 +0000 (14:31 +0200)]
Fix 'TOOLSDIR' when passed to 'src/AutoConf.hs'

Remove trailing parenthesis in 'TOOLSDIR' 'configure' variable when
passed to 'm4' to generate 'src/AutoConf.hs'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoImproves allocation parameters check in move-instance
Hrvoje Ribicic [Thu, 19 Sep 2013 17:45:23 +0000 (19:45 +0200)]
Improves allocation parameters check in move-instance

If the target cluster has a default iallocator, no allocation params
are needed. The parameter checks take this into account and do not
show errors anymore.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMove-instance can now change the disk template while moving
Hrvoje Ribicic [Thu, 19 Sep 2013 17:45:23 +0000 (19:45 +0200)]
Move-instance can now change the disk template while moving

By using the --dest-disk-template option, the move-instance utility
can change the disk template of the moved instance on-the-fly.
This is done by simply altering the disk template of the instance
created on the receiving end.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoHs2Py constants: update Python references
Jose A. Lopes [Wed, 18 Sep 2013 14:20:11 +0000 (16:20 +0200)]
Hs2Py constants: update Python references

Update references to the Python constants generated in the previous
patch.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add constants from types
Jose A. Lopes [Wed, 18 Sep 2013 14:20:02 +0000 (16:20 +0200)]
Hs2Py constants: add constants from types

Add the constants to the Hs2Py constant generation from the Haskell
data types moved in the previous patch.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMove data types from 'Objects' to 'Types'
Jose A. Lopes [Wed, 18 Sep 2013 14:19:47 +0000 (16:19 +0200)]
Move data types from 'Objects' to 'Types'

Move several Haskell data types from 'Ganeti.Objects' to
'Ganeti.Types' in order to be able to generate constants while
avoiding module circularity.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix conflicting path values from 'configure'
Jose A. Lopes [Thu, 19 Sep 2013 11:41:59 +0000 (13:41 +0200)]
Fix conflicting path values from 'configure'

Because the Hs2Py constant generation infrastructure is transitional,
there are two generated 'autoconf' modules, namely, 'src/AutoConf.hs'
and 'lib/_autoconf.py'.  However, conflicting values were being
generated for Haskell and Python concerning the variables
'OS_SEARCH_PATH', 'ES_SEARCH_PATH', and 'IALLOCATOR_SEARCH_PATH'.
This patch fixes this problem by placing these variables only on the
Haskell side and generate Python constants holding the correct value.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix constants for OOB commands
Jose A. Lopes [Thu, 19 Sep 2013 12:54:12 +0000 (14:54 +0200)]
Fix constants for OOB commands

Fix values of the constants for OOB commands, namely, 'oobPowerOn' and
'oobPowerCycle'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoThe $(gnt_python_sbin_SCRIPTS) are GENERATED_FILES
Klaus Aehlig [Thu, 19 Sep 2013 13:13:09 +0000 (15:13 +0200)]
The $(gnt_python_sbin_SCRIPTS) are GENERATED_FILES

Before the layout change, the corresponding scripts used to be
part of PYTHON_BOOTSTRAP, hence were already considered as
generated.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.9' into master
Klaus Aehlig [Thu, 19 Sep 2013 12:13:00 +0000 (14:13 +0200)]
Merge branch 'stable-2.9' into master

* stable-2.9
  Fix incorrect conflict resolution in lib/cmdlib/instance.py

* stable-2.8
  Version bump for 2.8 rc3
  Add a default to file-driver when unspecified over RAPI
  Remove typo from RAPI documentation
  Describe the files in doc/users in NEWS
  Update the upgrade procedure

* stable-2.7
  Fix incorrect manpage reference to htools

Conflicts (trivial):
lib/cmdlib/instance.py

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFor exported paths, use the canonical ones
Klaus Aehlig [Tue, 17 Sep 2013 13:11:57 +0000 (15:11 +0200)]
For exported paths, use the canonical ones

Some paths set that are set at configure time are needed at run
time. These are exported by the Makefile. Change this to export the
"canonical", unversioned, ones. This also has the advantage, that
tools do not have to know which programs are python scripts (where,
after following all the symbolic links, you end up under
$(prefix)/share/ due to the private-module layout) and which are
binaries (where you end up under $(prefix)/lib/).

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate description of --enable-symlinks
Klaus Aehlig [Tue, 17 Sep 2013 13:44:06 +0000 (15:44 +0200)]
Update description of --enable-symlinks

As most of the symlinks in our setup are, in fact, independent
of the Ganeti version, they can be installed unconditionally. So
the --enable-symlinks configure option now only controls a small
number of symlinks that decide which version of Ganeti is used.
Update the documentation accordingly.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdapt the version-dependent symlinks to the new design
Klaus Aehlig [Tue, 17 Sep 2013 13:40:16 +0000 (15:40 +0200)]
Adapt the version-dependent symlinks to the new design

With the latest change of our update design, there are only two
symbolic links left, that are specific to a particular version.
Those are only installed, if requested.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd the version-independent symbolic links
Klaus Aehlig [Mon, 16 Sep 2013 10:53:18 +0000 (12:53 +0200)]
Add the version-independent symbolic links

According to our new upgrade design, a couple of links are
version-independent, and should be installed always.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake version granularity a configure option
Klaus Aehlig [Thu, 12 Sep 2013 16:24:10 +0000 (18:24 +0200)]
Make version granularity a configure option

From 2.10 onwards, all files are installed into versioned
directories. As everything stays compatible between revisions,
it is not technically necessary, to have revisions included in
the directories. Nevertheless, there are situations where this
is desirable. So make it available at configure time, disabled
by default.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdapt the base directories according to new layout
Klaus Aehlig [Thu, 12 Sep 2013 11:39:37 +0000 (13:39 +0200)]
Adapt the base directories according to new layout

The file layout described in the upgrades design document has changed.
Adapt the base directories accordingly.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoHs2Py constants: update Python references
Jose A. Lopes [Tue, 17 Sep 2013 13:24:30 +0000 (15:24 +0200)]
Hs2Py constants: update Python references

Update Python references to all constants added in the previous patch,
which are the constants associated with the Haskell types declared in
'Ganeti.Types'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add constants from 'Ganeti.Types'
Jose A. Lopes [Tue, 17 Sep 2013 13:23:29 +0000 (15:23 +0200)]
Hs2Py constants: add constants from 'Ganeti.Types'

Add to Hs2Py constant generation all constants that are defined by the
Haskell defined declared in 'Ganeti.Types'.  This patch also fixes a
type inconsistency between Haskell and Python, namely, the constant
'cvAllEcodesStrings' which in Python was 'frozenset' and the type
generated in Haskell was 'List'.  With this patch, the Haskell type
becomes 'FrozenSet', the counterpart type to Python's 'frozenset'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix alloc related constants value
Jose A. Lopes [Tue, 17 Sep 2013 13:22:36 +0000 (15:22 +0200)]
Fix alloc related constants value

Fix alloc related constants to fetch their value from the respective
Haskell types, which are defined in 'Ganeti.Types'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'Ganeti.Types.OobStatus' for Hs2Py constants
Jose A. Lopes [Tue, 17 Sep 2013 13:19:31 +0000 (15:19 +0200)]
Add 'Ganeti.Types.OobStatus' for Hs2Py constants

Add 'Ganeti.Types.OobStatus' which is the Haskell counterpart to the
'OOB_STATUS_*' Python constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'PyValue' instance for triple
Jose A. Lopes [Tue, 17 Sep 2013 13:14:34 +0000 (15:14 +0200)]
Add 'PyValue' instance for triple

Add 'PyValue' instance for triple which is necessary for the
'CvErrorCode' related constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFetch 'randomUuidFile' from 'ConstantUtils'
Jose A. Lopes [Tue, 17 Sep 2013 13:13:30 +0000 (15:13 +0200)]
Fetch 'randomUuidFile' from 'ConstantUtils'

In 'Ganeti.Utils', update the reference to 'randomUuidFile' to fetch
the value from 'Ganeti.ConstantUtils' instead of the Python to Haskell
generated constant.  This allows breaking the dependency of
'Ganeti.Utils' on the constants module, which in turn will allow
constants to take their values from Haskell types without creating a
circular dependency. Update also the Python constant reference.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix indentation
Jose A. Lopes [Tue, 17 Sep 2013 13:20:46 +0000 (15:20 +0200)]
Fix indentation

Fix indentation to match Haskell coding conventions.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix missing constructors to 'CvErrorCode'
Jose A. Lopes [Tue, 17 Sep 2013 13:19:09 +0000 (15:19 +0200)]
Fix missing constructors to 'CvErrorCode'

Data type 'Ganeti.Types.CvErrorCode' is missing several constructors,
namely, 'CvEINSTANCEUNSUITABLENODE', 'CvEGROUPDIFFERENTPVSIZE',
'CvENODEDRBDVERSION', and 'CvEINSTANCEMISSINGCFGPARAMETER'.  This
fixes issue 580.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd constructor 'TagKindNetwork' to 'TagKind'
Jose A. Lopes [Tue, 17 Sep 2013 13:12:30 +0000 (15:12 +0200)]
Add constructor 'TagKindNetwork' to 'TagKind'

Add missing constructor 'TagKindNetwork' to 'Ganeti.Types.TagKind'
which is the counterpart of the Python constant 'TAG_NETWORK'.  This
fixes issue 578.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRename 'ExportModeRemove' to 'ExportModeRemote'
Jose A. Lopes [Tue, 17 Sep 2013 13:12:10 +0000 (15:12 +0200)]
Rename 'ExportModeRemove' to 'ExportModeRemote'

In "Ganeti.Types", rename constructor "ExportModeRemove" of
"ExportMode" to "ExportModeRemote".  This fixes issue 577.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix 'NICMode' missing 'NIC_IP_POOL'
Jose A. Lopes [Tue, 17 Sep 2013 13:20:29 +0000 (15:20 +0200)]
Fix 'NICMode' missing 'NIC_IP_POOL'

Fix, in 'Ganeti.Types', data type 'NICMode', which is missing a
constructor which is the counterpart of the Python constant
'NIC_IP_POOL'. This fixes issue 576.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoChange all types in 'Types' to use String
Jose A. Lopes [Mon, 16 Sep 2013 13:28:39 +0000 (15:28 +0200)]
Change all types in 'Types' to use String

Haskell types should be the source of information related to
constants.  Therefore, instead of building the Haskell types from the
constants, the constants should be taken from the Haskell types.  This
patch updates all the types defined in 'Ganeti.Types' to follow this
approach.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd missing exports in 'Ganeti.Types'
Jose A. Lopes [Tue, 17 Sep 2013 13:17:16 +0000 (15:17 +0200)]
Add missing exports in 'Ganeti.Types'

Add missing exports in 'Ganeti.Types' which are necessary for
'Ganeti.HsConstants'.  These exports concern the '*ToRaw' functions
which convert a Haskell type into JSON.  These functions are needed by
the constants which we want to generate from Haskell to Python based
on Haskell types.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add xen related constants
Jose A. Lopes [Mon, 16 Sep 2013 12:15:18 +0000 (14:15 +0200)]
Hs2Py constants: add xen related constants

Add xen related constants, such as, 'xenBootloader' and 'xenCmdXm' to
the Haskell to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add 'devConsole' and syslog related
Jose A. Lopes [Mon, 16 Sep 2013 12:11:06 +0000 (14:11 +0200)]
Hs2Py constants: add 'devConsole' and syslog related

Add 'devConsole' and syslog related constants to the Haskell to Python
constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd Template Haskell 'declareLADT'
Jose A. Lopes [Mon, 16 Sep 2013 13:26:31 +0000 (15:26 +0200)]
Add Template Haskell 'declareLADT'

Add 'declareLADT' in Template Haskell module to declare Haskell
datatypes using 'String's directly as values for the JSON
serialization, as opposed to 'Name's which is what the current
'declareADT' allows.  To achieve this, 'genFromRaw' must be
generalized, similarly to 'genToRaw'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix strings invalid with newer lint versions
Michele Tartara [Tue, 17 Sep 2013 15:33:48 +0000 (15:33 +0000)]
Fix strings invalid with newer lint versions

Generating ASCII characters via a supported but not official escape sequence
leads to a "Anomalous backslash in string" error in newer pylint versions. This
patch fixes the issue.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate Python references to exit code constants
Jose A. Lopes [Thu, 12 Sep 2013 15:19:14 +0000 (17:19 +0200)]
Update Python references to exit code constants

Update Python references to exit code constants to take their values
from the generated 'lib/_constants.py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHaskell to Python constants: add exit code constants
Jose A. Lopes [Mon, 16 Sep 2013 11:57:09 +0000 (13:57 +0200)]
Haskell to Python constants: add exit code constants

Add exit code constants to Haskell to Python constant generation
infrastructure.  The module 'Ganeti.ConstantUtils' must be imported
qualified in order to avoid a clash between
'Ganeti.ConstantUtils.exitFailure' and
'Ganeti.HsConstants.exitFailure'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate Python reference to 'DAEMONS_LOGBASE'
Jose A. Lopes [Thu, 12 Sep 2013 13:12:03 +0000 (15:12 +0200)]
Update Python reference to 'DAEMONS_LOGBASE'

Update Python reference of 'DAEMONS_LOGBASE' to fetch its value from
the generated 'lib/_constants.py' module.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHaskell to Python constants: add 'daemonsLogbase'
Jose A. Lopes [Mon, 16 Sep 2013 11:45:41 +0000 (13:45 +0200)]
Haskell to Python constants: add 'daemonsLogbase'

Move constant 'DAEMONS_LOGBASE' from Python to Haskell to be
automatically generated.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFlip dependency between Haskell types and constants
Jose A. Lopes [Mon, 16 Sep 2013 10:30:18 +0000 (12:30 +0200)]
Flip dependency between Haskell types and constants

Before this patch, Haskell types, such as, 'GanetiDaemon' and
'GanetiGroup', and related functions were taking their values from
Haskell constants.  However, given that the role of Haskell to Python
constants is to leverage Haskell and its typesystem, it makes sense to
first define the Haskell types and then have the constants depend on
these types.  In other words, this patch series inverts the dependency
between (some) Haskell types and constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoReplace import in 'Ganeti.Path'
Jose A. Lopes [Fri, 13 Sep 2013 11:00:27 +0000 (13:00 +0200)]
Replace import in 'Ganeti.Path'

Given that Haskell has its own generated 'AutoConf' module, it makes
sense that other Haskell modules import 'configure' variables directly
from 'AutoConf' instead of importing the Python to Haskell generated
constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix missing dependency on 'src/hs2py-constants'
Jose A. Lopes [Thu, 12 Sep 2013 13:16:45 +0000 (15:16 +0200)]
Fix missing dependency on 'src/hs2py-constants'

Fix missing dependency on target 'src/hs2py-constants' in
'Ganeti.ConstantUtils'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFurther tests for LUNodeAdd
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:18 +0000 (09:19 +0000)]
Further tests for LUNodeAdd

This patch adds tests for the remaining functionality of LUNodeAdd.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unittests for OpenvSwitch in LUNodeAdd
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:17 +0000 (09:19 +0000)]
Add unittests for OpenvSwitch in LUNodeAdd

This patch adds node_unittest.py containing the framework for unit
testing LUNodeAdd.
At this point, only test setup and tests for OpenvSwitch are
implemented.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoReplace more IPs with reserved adresses
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:17 +0000 (09:19 +0000)]
Replace more IPs with reserved adresses

Recently, some IP addresses were changed to TEST-NETs from RFC 5737.
This patch changes some more occurences of wrong IPs and replaces them.

TEST-NET-1 is used for primary_ips, TEST-NET-2 for networks and TEST-NET-3 for
secondary_ips.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMock RPC for unit tests
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:16 +0000 (09:19 +0000)]
Mock RPC for unit tests

This patch enables patching the rpc module to create a mocked version
which can be used to mock a rpc.DnsOnlyRunner(). This is needed for
unit testing LUNodeAdd, as it need to run RPCs against nodes not yet
present in the configuration.

Also, the default return IP of _GetHostnameMock needs to be changed, since
x.x.x.1 is the default IP of the first mocked node and will cause problems.

Parts of this patch were written by Thomas Thrainer.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix incorrect conflict resolution in lib/cmdlib/instance.py
Klaus Aehlig [Tue, 17 Sep 2013 12:36:56 +0000 (14:36 +0200)]
Fix incorrect conflict resolution in lib/cmdlib/instance.py

Between the last two merges, nothing happened on stable-2.9. The
only change on stable-2.8 that touched lib/cmdlib/instance.py is
ff34fb97. So make sure, the net change since the last merge to
this file is that of the said commit. This also fixes the doclint
errors.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Tue, 17 Sep 2013 09:59:36 +0000 (11:59 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Add a default to file-driver when unspecified over RAPI
  Remove typo from RAPI documentation
  Describe the files in doc/users in NEWS
  Update the upgrade procedure

* stable-2.7
  Fix incorrect manpage reference to htools

Conflicts:
NEWS
configure.ac
lib/cmdlib/instance.py
man/hroller.rst

All trivial, except for man/hrooler.rst, where the
fix in the section number was manually applied to the
new text.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoVersion bump for 2.8 rc3 v2.8.0rc3
Michele Tartara [Tue, 17 Sep 2013 08:43:02 +0000 (10:43 +0200)]
Version bump for 2.8 rc3

Also, add to the NEWS file a couple of items that were still missing.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMerge branch 'stable-2.7' into stable-2.8
Klaus Aehlig [Mon, 16 Sep 2013 11:52:45 +0000 (13:52 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  Fix incorrect manpage reference to htools

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix incorrect manpage reference to htools
Martin Zobel-Helas [Mon, 16 Sep 2013 11:42:46 +0000 (13:42 +0200)]
Fix incorrect manpage reference to htools

the manpages for hcheck, hinfo and hroller have an incorrect reference
to htools(7) which does not exist. This patch links them to htools(1).

This bug also fixes Debian BTS#721824 (http://bugs.debian.org/721824)

Signed-off-by: Martin Zobel-Helas <zobel@debian.org>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd a default to file-driver when unspecified over RAPI
Michele Tartara [Mon, 16 Sep 2013 11:06:31 +0000 (11:06 +0000)]
Add a default to file-driver when unspecified over RAPI

The file-driver value, used by file-based instances, had a default value when
an instance was being created over the CLI, but not when the instance was
created through the RAPI.

This patch introduces a default value for the remote API and, while doing so,
also centralizes in a single place the definition of such a value, for both the
interfaces, in order to remove the possibility for them to be out of sync.

Fixes Issue 571.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix monitoring daemon extra log filepaths
Jose A. Lopes [Mon, 16 Sep 2013 09:01:41 +0000 (11:01 +0200)]
Fix monitoring daemon extra log filepaths

Haskell constants 'daemonsExtraLogfilesGanetiMondAccess' and
'daemonsExtraLogfilesGanetiMondError' cannot be constants because
their Python counterparts are calculated through
'pathutils.GetLogFilename', which indirectly depends on the
environment variable 'GANETI_ROOTDIR', as part of the virtual cluster
configuration.  Instead, these paths must be computed at runtime, as
opposed to being computed at compile time through the Python to
Haskell constant generation, and must also depend on the same
environment variable.  Fixes issue 575.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix lint errors in fix keyerrors patch
Sebastian Gebhard [Fri, 13 Sep 2013 11:28:11 +0000 (11:28 +0000)]
Fix lint errors in fix keyerrors patch

This patch fixes one lint error introduced by my recent patch to
fix keyerrors in lib/cmdlib/node.py.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix example IPs and hostnames in tests
Klaus Aehlig [Fri, 13 Sep 2013 09:07:38 +0000 (11:07 +0200)]
Fix example IPs and hostnames in tests

Our tests are a form of documentation, and hence should use
IPs from the TEST-NET ranges according to RFC 5737. They definitely
should not use real public IP addresses.

Similarly, example host names should be from one of the reserved
domains according to RFC 2606.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoRemove typo from RAPI documentation
Michele Tartara [Fri, 13 Sep 2013 09:27:51 +0000 (09:27 +0000)]
Remove typo from RAPI documentation

"be used instead." was repeated twice.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix keyerrors in cmdlib node
Sebastian Gebhard [Sat, 24 Aug 2013 10:08:34 +0000 (10:08 +0000)]
Fix keyerrors in cmdlib node

This patch fixes potential key errors in the OpenvSwitch implementation
in cmdlib/node.py. The checks in that file expected to have a ndparams dict
with certain keys to be present. This should not be the case as it will
result in KeyErrors when those keys are not present.

Also: Don't assume that ndparams is given at all.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agodesign update: symlink structure
Klaus Aehlig [Mon, 9 Sep 2013 12:41:52 +0000 (14:41 +0200)]
design update: symlink structure

Update the upgrade design document according to the outcome
of the design discussion at GanetiCon 2013. There are two
changes in the design.

* As revision upgrades are binary compatible at all levels,
  one can accept a rough upgrade, just replacing the binaries.
  Therefore, it will become a configure option whether version
  includes revision and suffix, or not.

* The install/uninstall scripts are replaced in favor of another
  level of indirection. In this way, at run time, only two symlinks
  in ${sysconfdir}/ganeti, will be changed, whereas links under
  ${PREFIX}/bin, ${PREFIX}/sbin, and similar, are not touched by
  ganeti itself.

* The layout for the ganeti python libraries, which do not provide
  stable interface, are changed to be used as private modules.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake CPUload Data Collector aware of clock ticks
Spyros Trigazis [Tue, 10 Sep 2013 13:17:35 +0000 (16:17 +0300)]
Make CPUload Data Collector aware of clock ticks

Modify CPUload data collector to get the number of clock ticks
per second from Posix.Unistd. Since CPUload collector converts
clock ticks (jiffies) to seconds and the clock ticks to seconds
ratio varies between linux distributions, it must be read from
the corresponding library to be consistent.

Signed-off-by: Spyros Trigazis <strigazi@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd shelltest for the --ignore-dynu option of hbal
Klaus Aehlig [Mon, 9 Sep 2013 13:29:25 +0000 (15:29 +0200)]
Add shelltest for the --ignore-dynu option of hbal

In the example, we have two nodes and 6 instances, all using external
storage. There are four small instances on one node, and two big
instances, requiring twice the amount of resources of a small instance,
on the other node. So, with respect to static data, the cluster
is already perfectly balanced. Using the default assumption of
dynamic usage, however, the cluster can be improved by moving
one small instance to the other node. The reason is, that by default,
all instances are assumed to use the same resources, and this measure
dominates, as all static resources are greatly underutilized.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake hbal support the option --ignore-dynu
Klaus Aehlig [Tue, 10 Sep 2013 10:13:53 +0000 (12:13 +0200)]
Make hbal support the option --ignore-dynu

This will allow to do balancing based only on static information.
In particular, the effect of balancing towards same number of
instances per node that the dynamic usage consideration has
if no usage file is provided, can be turned off, if this is
desired.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake ExtLoader honor the --ignore-dynu option
Klaus Aehlig [Tue, 10 Sep 2013 11:40:00 +0000 (13:40 +0200)]
Make ExtLoader honor the --ignore-dynu option

Make the external data loader correctly honor the --ignore-dynu option
by clearing the dynamic utilisation data from all instances if the option
is given.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoProvide utility function to clear utilisation data
Klaus Aehlig [Tue, 10 Sep 2013 11:17:11 +0000 (13:17 +0200)]
Provide utility function to clear utilisation data

Using this utility function, the dynamic utilisation of all instances
can be set to 0. This will have the effect of all utilisation being ignored.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDefine a new option --ignore-dynu
Klaus Aehlig [Tue, 10 Sep 2013 09:52:11 +0000 (11:52 +0200)]
Define a new option --ignore-dynu

This option, if set, will tell htools to ignore any dynamic
use data.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDescribe the files in doc/users in NEWS
Klaus Aehlig [Thu, 12 Sep 2013 09:38:24 +0000 (11:38 +0200)]
Describe the files in doc/users in NEWS

While only a small feature, the files in doc/users can influence
the way ganeti is packaged. Hence it should be mentioned in the
news file.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate the upgrade procedure
Klaus Aehlig [Thu, 12 Sep 2013 09:08:34 +0000 (11:08 +0200)]
Update the upgrade procedure

Now that users-setup asks for confirmation, explain in the
procedure how asking for this confirmation can be skipped.
This skipping is particularly important for users following
the recommendation of using the distributed shell (dsh).

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd unit test for LUInstanceQuery and -QueryData
Thomas Thrainer [Tue, 27 Aug 2013 13:49:46 +0000 (15:49 +0200)]
Add unit test for LUInstanceQuery and -QueryData

This patch provides rudimentary unit test coverage for LUInstanceQuery
and LUInstanceQueryData.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceMigrate and -Failover
Thomas Thrainer [Tue, 27 Aug 2013 13:34:03 +0000 (15:34 +0200)]
Add unit tests for LUInstanceMigrate and -Failover

This patch adds rudimentary unit test coverage for LUInstanceMigrate and
LUInstanceFailover.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceChangeGroup
Thomas Thrainer [Thu, 22 Aug 2013 15:13:07 +0000 (17:13 +0200)]
Add unit tests for LUInstanceChangeGroup

This patch provides unit test coverage for LUInstanceChangeGroup.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUse RpcResult.Warn where appropriate
Thomas Thrainer [Wed, 11 Sep 2013 14:12:00 +0000 (16:12 +0200)]
Use RpcResult.Warn where appropriate

Those two occurrences of warnings can be replaced the RpcResult.Warn
method, which is done in this patch.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRemove unneeded except block
Thomas Thrainer [Wed, 11 Sep 2013 14:10:25 +0000 (16:10 +0200)]
Remove unneeded except block

The validation of the opcodes already checks the size parameter for the
right type, so this except block is not required.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRename variable to reflect its content
Thomas Thrainer [Wed, 11 Sep 2013 14:08:55 +0000 (16:08 +0200)]
Rename variable to reflect its content

Rename the "node" variable to "node_uuid" as that's the content it
actually receives.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceSetParams
Thomas Thrainer [Wed, 11 Sep 2013 14:05:17 +0000 (16:05 +0200)]
Add unit tests for LUInstanceSetParams

This patch adds unit tests for LUInstanceSetParams. It does not provide
100% coverage, but covers a significant portion.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix testMasterNetmask in TestLUClusterSetParams
Thomas Thrainer [Wed, 11 Sep 2013 14:06:29 +0000 (16:06 +0200)]
Fix testMasterNetmask in TestLUClusterSetParams

The netmask was previously wrongly given as a bitmask, now it's given as
the net prefix length.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix missing dependency in 'src/hs2py-constants'
Jose A. Lopes [Thu, 12 Sep 2013 11:56:24 +0000 (13:56 +0200)]
Fix missing dependency in 'src/hs2py-constants'

Fix target 'src/hs2py-constants' because it must depend on
'src/AutoConf.hs'. Fixes issue 573.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMerge branch 'stable-2.9' into master
Thomas Thrainer [Thu, 12 Sep 2013 11:23:29 +0000 (13:23 +0200)]
Merge branch 'stable-2.9' into master

* stable-2.9
  Fix bridging in net-common
  Sync build_chroot with buildbot slack role
  Auto-upgrade of disks' config wrt LD-renaming
  Fix tests regarding DISK_LD_DEFAULTS
  Fixing renaming of DISK_LD_DEFAULTS
  Replace LD_* constants with DT_* constants
  QA: fix file storage QA wrt ipolicy
  Bump versions to release 2.9~beta1
  Add design-2.9 to docinput
  NEWS update and version bump for 2.8 rc2
  Lint improvements to regexps
  Add unit test for GetLinuxNodeInfo
  Prepare GetLinuxNodeInfo for testing
  Check right disk template in inst set params
  Make the DRBD collector more failure-resilient
  Add function to unwrap Results logging failures
  Fix bug in NodeD and RapiD usage strings

* stable-2.8
  Make tools/users-setup explain its actions first
  Generate tools/users-setup from descriptions
  Provide ganeti user and group data in easy-to-parse form
  Remove dsahostkeypub during config downgrade
  Mark the DSA host pubkey as optional
  Fix documentation for gnt-node evacuate -p option

Conflicts:
Makefile.am (trivial)
devel/build_chroot (took changes from 2.9 but newer regex-pcre
                        version)
lib/cmdlib/cluster.py (followed LD_* -> DT_* change)
lib/objects.py (followed LD_* -> DT_* change)
test/py/ganeti.cmdlib_unittest.py (followed LD_* -> DT_* change)

The LD_* -> DT_* change required some more changes in the cmdlib unit
tests.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate reference to Python constants
Jose A. Lopes [Wed, 11 Sep 2013 10:41:40 +0000 (12:41 +0200)]
Update reference to Python constants

Update reference to 'DAEMONS_PORTS' and related constants that are
used on the Haskell side to construct the 'daemonsPorts' constant.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'daemonsPorts' and related constants
Jose A. Lopes [Wed, 11 Sep 2013 09:21:35 +0000 (11:21 +0200)]
Add 'daemonsPorts' and related constants

* add 'daemonsPorts' and related constants used in the construction of
  the 'Map' that maps each daemon to its corresponding protocol and
  port.  This breaks constant 'daemonsPortsGanetiNoded' which is
  automatically generated from the Python dictionary 'DAEMONS_PORTS'

* replace reference from constant 'daemonsPortsGanetiNoded' to
  'defaultNodedPort' because constant 'daemonsPortsGanetiNoded' was a
  tuple containing the protocol and the port for node daemon, but only
  the port was needed.  And because this tuple was making Haskell to
  Python constant generation more difficult, it is preferable to
  replace this tuple with the actual port and use it directly, in
  module 'Ganeti.Rpc'

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'Protocol' datatype
Jose A. Lopes [Wed, 11 Sep 2013 07:57:25 +0000 (09:57 +0200)]
Add 'Protocol' datatype

Add 'Protocol' datatype which is necessary for the 'daemonsPorts'
constant.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix instances of 'PyValue'
Jose A. Lopes [Wed, 11 Sep 2013 08:19:51 +0000 (10:19 +0200)]
Fix instances of 'PyValue'

Fix instances of 'PyValue', namely, for tuples and maps.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate references to Python constants
Jose A. Lopes [Wed, 11 Sep 2013 09:02:55 +0000 (11:02 +0200)]
Update references to Python constants

Update references to the Python constants introduced by the previous
patch.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHaskell to Python constants: more constants
Jose A. Lopes [Tue, 10 Sep 2013 13:45:51 +0000 (15:45 +0200)]
Haskell to Python constants: more constants

* move several groups of constants, from Python to Haskell, which are
  currently being used in Haskell, including SSH and daemon related
  constants, policy allocation, blockdev driver manual (this is a
  single constant), auto repair related constants, and data collector
  version (also a single constant)
* constant 'AUTO_REPAIR_ALL_RESULTS' is moved to Python and its type
  changes from '[String]' to 'FrozenSet String' in order to be
  consistent with the Python type
* fix tests related to the constant 'autoRepairAllResults' (i.e., the
  Haskell version of 'AUTO_REPAIR_ALL_RESULTS') to reflect the type
  change
* update instances of 'FrozenSet'

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Thomas Thrainer [Thu, 12 Sep 2013 08:55:43 +0000 (10:55 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Make tools/users-setup explain its actions first
  Generate tools/users-setup from descriptions
  Provide ganeti user and group data in easy-to-parse form
  Remove dsahostkeypub during config downgrade
  Mark the DSA host pubkey as optional
  Fix documentation for gnt-node evacuate -p option

Conflicts:
Makefile.am (trivial)
tools/cfgupgrade (removed downgrade code to 2.7)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMake tools/users-setup explain its actions first
Klaus Aehlig [Wed, 11 Sep 2013 09:00:15 +0000 (11:00 +0200)]
Make tools/users-setup explain its actions first

Before doing any changes, make tools/users-setup explain its
actions first, and ask the user for confirmation. If the first
argument is --yes-do-it, this step will be skipped.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoGenerate tools/users-setup from descriptions
Klaus Aehlig [Wed, 11 Sep 2013 08:27:23 +0000 (10:27 +0200)]
Generate tools/users-setup from descriptions

Now that we have a machine readable description of the users
to be added to the system, use it to generate the tools/users-setup
script, so that we again have only one authoritative source of
the user and group requirements. This also has the advantage of
of avoiding duplicate additions and attemps add a user root.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoProvide ganeti user and group data in easy-to-parse form
Klaus Aehlig [Tue, 10 Sep 2013 16:00:23 +0000 (18:00 +0200)]
Provide ganeti user and group data in easy-to-parse form

Upon build time, also generate, in the directory doc/users, files
containing the groups, the users with their primary group, and the
additional groupmemberships to be added. In this way, packages can use
their own way of adding users to the system, instead of telling the
adiministrator to run tools/users-setup.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoInconsistent auto repair related constant
Jose A. Lopes [Wed, 11 Sep 2013 08:14:17 +0000 (10:14 +0200)]
Inconsistent auto repair related constant

In 'lib/constants.py', fix inconsistency in the value of
'AUTO_REPAIR_TAG_SUSPENDED'. Fixes issue 569.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate constant references
Jose A. Lopes [Tue, 10 Sep 2013 11:13:11 +0000 (13:13 +0200)]
Update constant references

Update Python user separation constants to reference the generated
module 'lib/_constants.py' instead of 'lib/_autoconf.py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd user separation constants
Jose A. Lopes [Tue, 10 Sep 2013 11:11:12 +0000 (13:11 +0200)]
Add user separation constants

Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',
and 'rapiUser', to the Haskell to Python constant generation
infrastructure.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd target 'AutoConf.hs'
Jose A. Lopes [Wed, 21 Aug 2013 22:18:13 +0000 (00:18 +0200)]
Add target 'AutoConf.hs'

Add Makefile target to generate 'AutoConf.hs' and add this file to
'.gitignore'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>