- Mar 10, 2010
-
-
Iustin Pop authored
The upcoming python 2.6.5 release has a change that makes delattr(obj, attr) fail for slots-enabled objects if the attr is not already set. To prevent against this, we only run the delattr if the attribute is already set. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
This makes it the first argument show, for example under "ps". Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Newer virtio can boot from the network perfectly well, so there's no point in keeping this restriction in place. This will still fail on older kernels. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
The gnt-instance manpage only contained the correct syntax for xen-pvm. Specify what the kvm syntax is, and also warn about a problem with virtio+netboot, for older kvm versions. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
To simplify writing unittests, one data structure class in http.server is also changed. According to the coverage utility, this provides 95% coverage. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
When username and password were sent for a resource not requiring authentication, it wouldn't be accepted if the user in question had a hashed password. The reason was that the function GetAuthRealm used to return None if no authentication was necessary. However, the authentication realm is necessary to verify hashed passwords. This is fixed by requiring GetAuthRealm to always return a realm and separating the decision whether to require authentication or not to a separate function. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Mar 09, 2010
-
-
Guido Trotter authored
There were a few outdated options specified there. This patch unifies the description under only one section, and updates it. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This allows one to cleanly set a node offline and promote as needed other nodes. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The current code in LUSetNodeParms regarding the demotion from master candidate role is complicated and duplicates the code in ConfigWriter, where such decisions should be made. Furthermore, we still cannot demote nodes (not even with force), if other regular nodes exist. This patch adds a new opcode attribute ‘auto_promote’, and changes the decision tree as follows: - if the node will be set to offline or drained or explicitly demoted from master candidate, and this parameter is set, then we lock all nodes in ExpandNames() - later, in CheckPrereq(), if the node is indeed a master candidate, and the future state (as computed via GetMasterCandidateStats with the current node in the exception list) has fewer nodes than it should, and we didn't lock all nodes, we exit with an exception - in Exec, if we locked all nodes, we do a AdjustCandidatePool() run, to ensure nodes are locked as needed (we do it before updating the node to remove a warning, and prevent the situation that if the LU fails between these, we're not left with an inconsistent state) Note that in Exec we run the AdjustCP irrespective of any node state change (just based on lock status), so we might simplify the CheckPrereq even more by not checking the future state, basically requiring auto_promote/lock_all for master candidates, since the case where we have more than needed master candidates is rarer; OTOH, this would prevent manual promotion ahead of time of another node, which is why I didn't choose this way. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently backend.NodeVolumes() drops everything except the first PV, thus we get a truncated result. The patch is not the nicest, as Python doesn't have a simple `concat' function, so I had to change the list comprehension to an explicit loop. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The return from LUVerifyCluster should be True (or equivalent) for pass, and False (or equivalent) for fail. The HooksCallBack function uses '1' (= True) when a hook fails, which is exactly the opposite of what we want - it will make failed hooks to reset the result to success, overriding actual failures in cluster verify. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
We need to manually filter out offline nodes before using rpc.call_upload_file and rpc.call_write_ssconf_files, since these method are static (they work without a ConfigWriter instance) and thus do not know which nodes are offline and which are not). Note that we add a new ConfigWriter._UnlockedGetOnlineNodeList() method rather than hardcoding the filtering of online nodes in _WriteConfig. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
This finishes the integration of per-os-hypervisor parameters by updating the man page. Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
Introduce “gnt-os modify” command to make it possible to set the per-os-hypervisor parameters. Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
Let gnt-cluster info show us the per-os-hypervisor parameters. Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
This patch implements all modifications to support per-os-hypervisor parameters in the framework. Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Mar 08, 2010
-
-
Timothy Kuhlman authored
Each nic should be connected to its own qemu vlan, to avoid them all bridging together. Signed-off-by:
Timothy Kuhlman <timkuhlman@gmail.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This way we can re-use file objects opened in other places. Also add more unittests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch adds validation of new names used, i.e. at cluster init time, node add time, and instance creation. For instances, especially when using «--no-name-check» (which skips DNS checks), we should validate the give name, and also normalize it (otherwise, we could have two instances named inst1 and Inst1). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This differs slightly from the specification, by allowing names to start with digits, not checking the length of individual components, and allowing underscores. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This patch changes ListVisibleFiles to raise ProgrammerError if it's passed a non-absolute/non-normalized path name, and adds unittests for this behaviour. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This should remove most of the remaining constructs which can be replaced by PathJoin. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Since in objects we don't have access to utils.py, we add a warning that the result value from objects.Disk.StaticDevPath might not be a valid path, and change its only caller to validate the path. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This switches hv_kvm to PathJoin. There are still a few cases of direct path construction, but those _should_ be safe. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This changes to hv_fake to PathJoin. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This patch abstract the computation of an instance's root directory into a separate function (that uses PathJoin instead of "%s/%s"). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Currently we don't enforce name validation for the LVM backend, on the idea that LVM itself will reject invalid names and we catch those errors. However, recent LVM documents the accepted VG/LV name space, so it's easy to add this in the LVM backend code. In addition, the patch changes some hardcoded /dev/ constructions with utils.PathJoin(). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Rationale: the file-based storage backend can add/remove files under a certain directory. However, the master node is also controlling the setting of the file-based root directory, so basically it means we can't prevent arbitrary modifications by the master of the node's filesystem. In order to mitigate this for setups where the file-based storage is not used, we introduce a new setting at ./configure time, that controls the enable/disable of file-based storage. Since this is not modifiable by the master (over RPC), it is now possible in this case to prevent unintended modifications of the node's filesystem from the master. The new setting is used in bdev.py to not expose the file-based storage at all, and in cmdlib.py to prevent attempts at creation of such instances. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This is a no-op change, but at least we concentrate the calls to path joins into a single function. A use in utils.FindFile is left as-is (don't want to raise exceptions there, at least for now). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The various OS operations create log files in a specific directory (constants.LOG_OS_DIR). The construction of the log names is however spread and duplicated across multiple functions. This patch abstracts this into a separate function that also validates the log name, which should be safer in the long run. We also rename the export logs from having a prefix of “exp” to “export”, since it was the only operation that had an abbreviated prefix. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
For non-existing hooks (the majority of cases probably), logging a warning every time is not helpful. So we first check if we have a valid directory. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This passes a full burnin with lots of instances, and should be safe as we mostly to join a known root (various constants) to a run-time variable. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This will replace os.path.join since it is not safe for directory traversal issues. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
In order to protect from accidental use of _CleanDirectory on a random directory, we add a list of allowed clean directories, somewhat similar to _ALLOWED_UPLOAD_FILES (but statically computed). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Mar 02, 2010
-
-
Vitaly Kuznetsov authored
Using absolute path for a privileged command is a bad idea as this path may vary. For example /usr/sbin/brctl in Debian and /sbin/brctl in ALTLinux. Using $PATH is a better idea. Signed-off-by:
Vitaly Kuznetsov <vitty@altlinux.ru> Reviewed-by:
Iustin Pop <iustin@google.com> Signed-off-by:
Iustin Pop <iustin@google.com>
-