Add MonD's latest API Version in lib/constants.py
Extract the version number from MonD's own file into the constants file, so thatis can be accessed from other parts of the system as well (e.g.: to performqueries over the MonD protocol).
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>...
Update hail, hbal and htools man-pages
Update hail, hbal and htools man-pages to include the use of dataprovided by MonD.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Prevent lint error in mocked classes
Accessing private methods of parent classes is bad, but it is sometimes the bestapproach for classes mocking them for testing reasons.Selectively disable the related lint error just for the few functions that needto do it....
Fix indentation for newer lints
Newer versions of pylint are more strict regarding indentation rules. Thiscommit fixes a couple of indentations that they consider wrong.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Use secondary IP when moving instances
All data traffic usually goes over the secondary network, butgnt-instance move didn't. This patch corrects this problem by using thetarget nodes secondary IP as move target.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Add 'generated from' comments in Hs2py constants
Modify Hs2Py constants to include a comment in the generated commentsdescribing the source of those constants. Fixes issue 588.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Honor disks_active of instance when adding disks
Adding a disk to an instance used to leave the disk behind activated, nomatter how the disks_active flag of the instance was. This changes makesure that new disks are only active if the other disks of the instance...
Mention changed default disk add behavior in NEWS
As the default behavior of adding disks has changed (now waiting fordisk synchronization is done per default), mention this change in theNEWS file.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Document --no-wait-for-sync for adding disks
The already present option '--no-wait-for-sync' in`gnt-instance modify` is now also mentioned in the part which describesadding a disk.
Wait for disk sync when adding a disk
When creating an instance, gnt-instance waits for instance disks tosync. Inconsistently, this was not the case for adding a disk to aninstance. This patch changes the default behavior to wait for sync whenadding a disk, but honor the --no-wait-for-sync option which...
Merge branch 'stable-2.9' into master
Disable hlint camelcase on test module
Haskell test modules contain functions which have names containingunderscore. Add hlint annotation to disable this check.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Merge branch 'stable-2.8' into stable-2.9
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Fix expansion in Makefile.am
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Fix comment in 'configure.ac'
Fix comment for a configure parameter in 'configure.ac' to beconsistent with the remaining parameters.
Fix 'src/mon-collector.hs' source in dist
This patch fixes 'Makefile.am' to include the source file of'mon-collector' in the distribution tarball even if the monitoringdaemon has been disabled at configure time. Fixes issue 587.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Move 'BuildVersion' to 'lib/utils/version.py'
Functions 'BuildVersion' and 'SplitVersion' are no longer needed bythe constants and, given that they are not constants, they should bemoved elsewhere. Since they are only used by 'cfgupgrade' and tests,these functions are moved to 'lib/utils/version.py' and references to...
HUnit test for 'buildVersion'
Add 'HUnit' test for 'buildVersion'.
Remove '_autoconf'
The previous patch has made '_autoconf' obsolete. This patchcompletely removes '_autoconf' and the 'Makefile' targets for it.
Hs2Py constants: update Python references
Update references to constants that were previously in the generated'lib/_autoconf.py' and since the previous patch have been included inthe Hs2Py constant generation.
Hs2Py constants: add remaining '_autoconf.*' constants
Add remaining constants which in Python are imported from thegenerated 'lib/_autoconf.py'. This will allow to completely removethis module.
Hs2Py constants: update Python references to autoconf
Update Python references to all constants that used to point to thegenerated 'lib/_autoconf.py', which has been superseeded by theHaskell counterpart 'src/AutoConf.hs'.
Hs2Py constants: add all 'AutoConf' and related constants
Add all constants in 'AutoConf' to the Hs2Py constant generation and'socatEscapeCode' because it is part of the group containing'socatPath', 'socatUseCompress', and 'socatUseEscape'.
Add 'buildVersion' for calculating Ganeti versions
Add 'buildVersion' which calculates Ganeti versions and it is theHaskell counterpart of 'BuildVersion' in 'lib/constants.py'.
Fix sign in default-yes for --enable-versionfull
The default for using the full version string in the directoryis not to use it. If the option --enable-versionfull is given,its argument should default to yes. That means that everythingthat is not a "no" should be interpreted as yes....
Including missing RST files in packaging
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
The patch was released by the author into the public domain.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Update supported lint tools version numbers
Linting is now verified against the lint tools version numbers as listed in thispatch.
These version are corresponding to the ones that can be found in therepositories of Ubuntu 13.04.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Fix some wrong indentations in the code
Fix all instances of pep8's error: "E128 continuation line under-indented forvisual indent".
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Disable parenthesis indentation check
More recent versions of pep8 check for the indentation level of closingparenthesis in a way that is incompatible with the way we use in our code. Ourstyle is still pep8 compliant, and was re-allowed in even more recent versions...
Fix an improperly escaped string
Mark a string representing a "sed" command including a regular expression as araw string, so that the entire escaping is performed by "sed" itself.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Make QaConfig a proper container
Newer pylint versions complain that QaConfig is not a proper container becauseit does not implement the len(), delitem() and setitem() methods.This commit implements them.
Make QmpMessage a proper container
Newer pylint versions complain that QmpMessage is not a proper container becauseit does not implement the len() and delitem() methods. This commitimplements them.
Also, tests are added.
Prevent static field checking for dynamic classes
In order to check for the correctness of the accesses to fields of objects,pylint uses astng, but this is known to fail on some dynamically generatedclasses. Still, newer pylint versions are stricter at performing this check, and...
Fix metaclasses support in recent pylint versions
Recent versions of pylint require the first parameter of a metaclass to be"cls". Older versions want "mcs". There's no way to support both by changing thecode, so the configuration file of pylint is changed instead, to have the...
Update references of Python constants in the previous patch to fetchtheir values from the generated Haskell to Python constants.
Hs2Py constants: add 'confd' related constants
Add 'confd' related constants to the Hs2Py constant generation.
Update references of the Python constants that were introduced in theprevious patch.
Hs2Py constants: add some constants
Add 'opcodeReason', 'diskstatsFile', 'statFile', and'mondTimeInterval', to the Hs2Py constant generation.
Organize Haskell constants
Reorder Haskell constants to match the order in the Python constantsmodule 'lib/constants.py' to make it easier to debug/trace the Hs2Pyconstant migration process.
design: replace 'gnt-upgrade' by 'gnt-cluster upgrade'
Instead of using a separate binary, add the upgradefunctionality to gnt-cluster.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix RPC call to blockdev_getdimensions
The parameter format for call_blockdev_getdimensions has changed in aprevious patch. Here, the correct parameter format is used for the RPCcall.
Fix cfgupgrade test wrt. downgrading physical_id
The physical_id field can't be recreated during downgrades, so don'texpect it to be during the test.
Display node names instead of node UUIDs
Display resolved node names instead of node UUIDs in a couple ofwarnings and log messages.
Only serialize dynamic_params on demand
To make sure that the dynamic_params field is not serialized by accidentto the configuration file only include it in the serialization whenexplicitly asked for.
Remove physical_id field reference from tools
Remove remaining references to the physical_id field in cluster-mergeand sanitize-config.
Remove physical_id field from disks during upgrade
The physical_id field is no longer supported in disk objects, so removeit during upgrades.
Remove physical_id from config mock
Disk objects no longer support the physical_id field, so remove it frommocked disk objects.
Fix tests related to the physical_id field
Remove all references to the physical_id field of disk objects in tests.
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 surethat the physical_id is up to date when transmitted over RPC.
Replace physical_id with dynamic_params
The disk field 'physical_id' has to be kept up to date whenever a diskobject is sent to a node via RPC. This is done with the SetDiskID methodmanually, which is a source of bugs.
This patch replaces the use of 'physical_id' with a new field names...
Fix typo
Fix typo in comment.
Handle $(python_scripts) and tools/burnin as python scripts
With the new private-module layout, python scripts using theganeti module must end up in $(versionedsharedir) in orderto see this private module.
Provide PYTHONPATH to burnin
One feature of the new private-module layout is that a pythonscript cannot simply 'import ganeti'. The reason is that theinterfaces to these modules are not stable and hence should notbe used outside Ganeti. However, this is what the burnin test...
Export VERSIONEDSHAREDIR to _autoconf.py
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 thetarget 'src/AutoConf.hs' in 'Makefile.am'.
Also install the version-dependent links forcefully
In this way, with default configuration options, runningmake install twice in a row succeeds. Fixes issue 567.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Hs2Py constants: update 'SF_*' references
Update references to storage field Python constants to fetch theirvalues from 'lib/_constants.py'.
Hs2Py constants: add storage fields
Add storage fields constants to the Haskell to Python constantgeneration. These constants fetch their values from the Haskell datatype 'StorageField'.
Move 'StorageField' to 'Ganeti.Types'
Move 'StorageField' to 'Ganeti.Types' in order to break thecircularity of 'Ganeti.Rpc' and be able to generate constants fromthis Haskell data type.
Fix 'TOOLSDIR' when passed to 'src/AutoConf.hs'
Remove trailing parenthesis in 'TOOLSDIR' 'configure' variable whenpassed to 'm4' to generate 'src/AutoConf.hs'.
Add additional tests for utils.Retry
Also have some tests where the time the various components(inspecting the time function, calling the function, etc) havea non-trivial time. Also, have two tests demonstrating thatthe number of retries actually depends on the amount of time...
Make retry tests independent of actual time
Even in the tests, real time is used. While, generally, the assumptionsabout execution time are pretty safe, in some rare circumstances, e.g.,on machines with extremely heavy load they do not hold true, thus rendering...
Fix corner-case in handling of remaining retry time
Consider a remaining time of 0 as already timed out. Otherwise,there is no guarantee that calling utils.Retry with timeout 0will call the function precisely once; it might run in timeshorter than the resolution of timer....
Improves allocation parameters check in move-instance
If the target cluster has a default iallocator, no allocation paramsare needed. The parameter checks take this into account and do notshow errors anymore.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Move-instance can now change the disk template while moving
By using the --dest-disk-template option, the move-instance utilitycan change the disk template of the moved instance on-the-fly.This is done by simply altering the disk template of the instance...
Update references to the Python constants generated in the previouspatch.
Hs2Py constants: add constants from types
Add the constants to the Hs2Py constant generation from the Haskelldata types moved in the previous patch.
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 whileavoiding module circularity.
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 beinggenerated for Haskell and Python concerning the variables...
Fix constants for OOB commands
Fix values of the constants for OOB commands, namely, 'oobPowerOn' and'oobPowerCycle'.
The $(gnt_python_sbin_SCRIPTS) are GENERATED_FILES
Before the layout change, the corresponding scripts used to bepart of PYTHON_BOOTSTRAP, hence were already considered asgenerated.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>...
For exported paths, use the canonical ones
Some paths set that are set at configure time are needed at runtime. These are exported by the Makefile. Change this to export the"canonical", unversioned, ones. This also has the advantage, thattools do not have to know which programs are python scripts (where,...
Update description of --enable-symlinks
As most of the symlinks in our setup are, in fact, independentof the Ganeti version, they can be installed unconditionally. Sothe --enable-symlinks configure option now only controls a smallnumber of symlinks that decide which version of Ganeti is used....
Adapt the version-dependent symlinks to the new design
With the latest change of our update design, there are only twosymbolic links left, that are specific to a particular version.Those are only installed, if requested.
Add the version-independent symbolic links
According to our new upgrade design, a couple of links areversion-independent, and should be installed always.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Make version granularity a configure option
From 2.10 onwards, all files are installed into versioneddirectories. As everything stays compatible between revisions,it is not technically necessary, to have revisions included inthe directories. Nevertheless, there are situations where this...
Adapt the base directories according to new layout
The file layout described in the upgrades design document has changed.Adapt the base directories accordingly.
Update Python references to all constants added in the previous patch,which are the constants associated with the Haskell types declared in'Ganeti.Types'.
Hs2Py constants: add constants from 'Ganeti.Types'
Add to Hs2Py constant generation all constants that are defined by theHaskell defined declared in 'Ganeti.Types'. This patch also fixes atype inconsistency between Haskell and Python, namely, the constant...
Fix alloc related constants value
Fix alloc related constants to fetch their value from the respectiveHaskell types, which are defined in 'Ganeti.Types'.
Add 'Ganeti.Types.OobStatus' for Hs2Py constants
Add 'Ganeti.Types.OobStatus' which is the Haskell counterpart to the'OOB_STATUS_*' Python constants.
Add 'PyValue' instance for triple
Add 'PyValue' instance for triple which is necessary for the'CvErrorCode' related constants.
Fetch 'randomUuidFile' from 'ConstantUtils'
In 'Ganeti.Utils', update the reference to 'randomUuidFile' to fetchthe value from 'Ganeti.ConstantUtils' instead of the Python to Haskellgenerated constant. This allows breaking the dependency of'Ganeti.Utils' on the constants module, which in turn will allow...
Fix indentation
Fix indentation to match Haskell coding conventions.
Fix missing constructors to 'CvErrorCode'
Data type 'Ganeti.Types.CvErrorCode' is missing several constructors,namely, 'CvEINSTANCEUNSUITABLENODE', 'CvEGROUPDIFFERENTPVSIZE','CvENODEDRBDVERSION', and 'CvEINSTANCEMISSINGCFGPARAMETER'. Thisfixes issue 580....
Add constructor 'TagKindNetwork' to 'TagKind'
Add missing constructor 'TagKindNetwork' to 'Ganeti.Types.TagKind'which is the counterpart of the Python constant 'TAG_NETWORK'. Thisfixes issue 578.
Rename 'ExportModeRemove' to 'ExportModeRemote'
In "Ganeti.Types", rename constructor "ExportModeRemove" of"ExportMode" to "ExportModeRemote". This fixes issue 577.
Fix 'NICMode' missing 'NIC_IP_POOL'
Fix, in 'Ganeti.Types', data type 'NICMode', which is missing aconstructor which is the counterpart of the Python constant'NIC_IP_POOL'. This fixes issue 576.
Change all types in 'Types' to use String
Haskell types should be the source of information related toconstants. Therefore, instead of building the Haskell types from theconstants, the constants should be taken from the Haskell types. Thispatch updates all the types defined in 'Ganeti.Types' to follow this...
Add missing exports in 'Ganeti.Types'
Add missing exports in 'Ganeti.Types' which are necessary for'Ganeti.HsConstants'. These exports concern the '*ToRaw' functionswhich convert a Haskell type into JSON. These functions are needed bythe constants which we want to generate from Haskell to Python based...
Perform proper cleanup on termination of Haskell daemons
Haskell deamons did not perform proper cleanup at termination. There was no codefor removing the pid file, and the code in LuxiD for removing the unix socketfile was not working, because it is implemented with a "finally" statement,...
Hs2Py constants: add xen related constants
Add xen related constants, such as, 'xenBootloader' and 'xenCmdXm' tothe Haskell to Python constant generation.
Hs2Py constants: add 'devConsole' and syslog related
Add 'devConsole' and syslog related constants to the Haskell to Pythonconstant generation.
Add Template Haskell 'declareLADT'
Add 'declareLADT' in Template Haskell module to declare Haskelldatatypes using 'String's directly as values for the JSONserialization, as opposed to 'Name's which is what the current'declareADT' allows. To achieve this, 'genFromRaw' must be...
Fix strings invalid with newer lint versions
Generating ASCII characters via a supported but not official escape sequenceleads to a "Anomalous backslash in string" error in newer pylint versions. Thispatch fixes the issue.
Update Python references to exit code constants
Update Python references to exit code constants to take their valuesfrom the generated 'lib/_constants.py'.
Haskell to Python constants: add exit code constants
Add exit code constants to Haskell to Python constant generationinfrastructure. The module 'Ganeti.ConstantUtils' must be importedqualified in order to avoid a clash between'Ganeti.ConstantUtils.exitFailure' and...
Update Python reference to 'DAEMONS_LOGBASE'
Update Python reference of 'DAEMONS_LOGBASE' to fetch its value fromthe generated 'lib/_constants.py' module.
Haskell to Python constants: add 'daemonsLogbase'
Move constant 'DAEMONS_LOGBASE' from Python to Haskell to beautomatically generated.