ganeti-local
11 years agoFix typo in docstring
Christos Stavrakakis [Tue, 26 Feb 2013 16:49:18 +0000 (18:49 +0200)]
Fix typo in docstring

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agorapi.rst: Replace manual method lists with directive
Michael Hanselmann [Fri, 22 Feb 2013 14:19:12 +0000 (15:19 +0100)]
rapi.rst: Replace manual method lists with directive

Many resources, but not all, list their supported methods. With a new
reST directive, this list is now automatically generated and also lists
the required permissions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoHRoller: allow filtering by node group
Guido Trotter [Thu, 21 Feb 2013 21:40:14 +0000 (13:40 -0800)]
HRoller: allow filtering by node group

Accept the -G option, and if it's passed require that it matches a
nodegroup, then only output nodes belonging to that group.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoHRoller: print only online nodes
Guido Trotter [Thu, 21 Feb 2013 21:37:41 +0000 (13:37 -0800)]
HRoller: print only online nodes

To make the graphs work even when instances live on offline nodes (eg.
because we're offlining them just to exclude them, or because they have
instance still on them) we just filter them out at the end, when we're
going to print out the result.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoOfficially require Python 2.6+
Guido Trotter [Thu, 21 Feb 2013 17:50:55 +0000 (09:50 -0800)]
Officially require Python 2.6+

We have no way to test Python 2.4 compatibility anymore, and that
version is long deprecated. From version 2.8+ require Python 2.6 or
above (but still not 3.0).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agobootstrap: Wait for SSH daemon to become reachable
Michael Hanselmann [Thu, 21 Feb 2013 17:45:42 +0000 (18:45 +0100)]
bootstrap: Wait for SSH daemon to become reachable

In some situations after restarting the SSH daemon by
“prepare-node-join” it's not immediately reachable. Like with the master
and node daemons, waiting for it to become reachable instead of failing
hard can help in such situations.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoTcpPing: Better error handling, logging
Michael Hanselmann [Thu, 21 Feb 2013 17:44:35 +0000 (18:44 +0100)]
TcpPing: Better error handling, logging

Log every attempt to reach a port on another node. Don't silently return
False if a target not recognized as an IP address is given (e.g. a
hostname).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoWipe disks added through "gnt-instance modify"
Michael Hanselmann [Mon, 25 Feb 2013 15:27:27 +0000 (16:27 +0100)]
Wipe disks added through "gnt-instance modify"

In issue 353 Sascha Lucas reported that disks are not wiped when added
through “gnt-instance modify”. This patch adds this functionality and
updates the docstring for “_WipeDisks”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agovcluster-setup: Create $vnode/etc/ganeti directory
Michael Hanselmann [Thu, 21 Feb 2013 15:47:23 +0000 (16:47 +0100)]
vcluster-setup: Create $vnode/etc/ganeti directory

This directory is required by “cfgupgrade” and some other tools.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoconstants: Use SSH constant for daemon ports
Michael Hanselmann [Thu, 21 Feb 2013 17:43:28 +0000 (18:43 +0100)]
constants: Use SSH constant for daemon ports

Moving the SSH/SCP constants around was necessary for this.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix style violations in commit 4a90bd4, small changes
Michael Hanselmann [Fri, 22 Feb 2013 15:50:41 +0000 (16:50 +0100)]
Fix style violations in commit 4a90bd4, small changes

- Commit 4a90bd4 contained a rather large number of style violations:
  - Indentation/sequence formatting
  - Wrapping of long lines
  - Docstrings whose first line was wrapped
  - A stray backslash in a docstring
- opcodes: Don't check for list or tuple. None of the other opcodes does
  it explicitely. As long as the length and the items match the value is
  accepted.
- server/noded: “if variable” doesn't test for None, but False

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: New directive for supported methods
Michael Hanselmann [Fri, 22 Feb 2013 14:18:56 +0000 (15:18 +0100)]
sphinx_ext: New directive for supported methods

Until now many resources, but not all and not consistently list their
supported methods (e.g. “Supports the following commands: ``GET`` …”).
Not only is it easy for this list to get out of date, but it would also
be nice if it listed the required access permissions.

This patch adds a new directive to insert a table listing all supported
methods and their access permissions for a resource.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: Factorize getting RAPI handlers
Michael Hanselmann [Fri, 22 Feb 2013 14:17:17 +0000 (15:17 +0100)]
sphinx_ext: Factorize getting RAPI handlers

The list of resources and handlers will also be used for generating
a per-resource table.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agosphinx_ext: Factorize handler methods/access
Michael Hanselmann [Fri, 22 Feb 2013 14:12:50 +0000 (15:12 +0100)]
sphinx_ext: Factorize handler methods/access

The factorized parts will be used to show a small table with methods and
required permissions for each resource.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUse "none" instead of "everyone" in RAPI documentation
Michael Hanselmann [Fri, 22 Feb 2013 14:07:08 +0000 (15:07 +0100)]
Use "none" instead of "everyone" in RAPI documentation

The list of required access permissions uses the word “everyone” to mean
“no special permissions are needed”. The word “none” fits better.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years ago.gitignore: Add test/hs/harep
Michael Hanselmann [Fri, 22 Feb 2013 15:57:51 +0000 (16:57 +0100)]
.gitignore: Add test/hs/harep

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dato Simó <dato@google.com>

11 years agoRewrap a comment in constants.py
Iustin Pop [Mon, 25 Feb 2013 08:40:42 +0000 (09:40 +0100)]
Rewrap a comment in constants.py

As it was 80 chars, and you know that bothers me :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoEnable split queries for export in CLI
Iustin Pop [Fri, 22 Feb 2013 12:18:45 +0000 (13:18 +0100)]
Enable split queries for export in CLI

Rapi doesn't seem to export backup lists, so we enable the split query
only in gnt-backup.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoImprove the rpc-test program
Iustin Pop [Fri, 22 Feb 2013 11:25:18 +0000 (11:25 +0000)]
Improve the rpc-test program

This is an ugly patch, sorry. It adds the following features to
rpc-test, to help with (stress) testing the Haskell RPC client:

- customisable repeat count for the RPCs
- customisable parallelisation factor
- options to show timing stats and other information
- capability to execute any RPCs already defined, as opposed to having
  the RPC hardcoded; this requires a data file (defaulting to
  "rpc.json") that has the serialised RPC call

The polymorphism/way the RPC library is implemented requires us to
have some duplicate code (operating on different types); I wasn't able
to found a way to make this more abstract.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImplement Export queries in Haskell
Iustin Pop [Thu, 21 Feb 2013 16:52:15 +0000 (17:52 +0100)]
Implement Export queries in Haskell

This is a simple query as it has only two fields, however it's the
first query that doesn't have a clear 'base' object and 1:1
correspondence between such objects and the results (groups, nodes and
networks do so).

We keep nodes as the 'base' object, since that's what we want to
filter on for RPC selection, and we have a very simple type as the
runtime type, since we only have one other field. The
'collectLiveData' function is the one that does the expansion from
[node] to [(node, path)], with the help of 'rpcExtractor'.

Also, this patch introduces a slightly different naming structure for
the exported names out of the module, to reduce naming conflicts.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix exports query with failed RPCs
Iustin Pop [Thu, 21 Feb 2013 16:41:34 +0000 (17:41 +0100)]
Fix exports query with failed RPCs

When the RPC to a node has failed (for whatever reason), we currently
return _FS_UNAVAIL, which means "this node doesn't support
exports". However, that is misleading: all nodes support exports, but
we failed to list them at the moment, so _FS_NODATA (temporary
failure) is more appropriate here.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoAdd export_list RPC call definitions
Iustin Pop [Thu, 21 Feb 2013 13:54:19 +0000 (14:54 +0100)]
Add export_list RPC call definitions

This is straightforward, as the call has no parameters and a very simple return type.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImprove TemplateHaskell code to support empty objects
Iustin Pop [Thu, 21 Feb 2013 13:52:07 +0000 (14:52 +0100)]
Improve TemplateHaskell code to support empty objects

Currently, an empty objects will generate warnings as the arguments of
various functions are unused. By adding conditional code for this, we
can support generation of empty objects, e.g. like needed in Rpc code.

Additionally, the patch also converts RpcCallVersion to THH, now that
it can build it. We change the serialisation for this (from JSNull to
JSObject []), but this shouldn't matter as this is not used in
production.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix Curl/Internal.hs not being in gitignore
Iustin Pop [Thu, 21 Feb 2013 16:38:27 +0000 (17:38 +0100)]
Fix Curl/Internal.hs not being in gitignore

This is an autogenerated file, so it has to go into gitignore, thanks
Michael!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd option to redirect luxi socket for debugging
Iustin Pop [Thu, 21 Feb 2013 12:51:03 +0000 (13:51 +0100)]
Add option to redirect luxi socket for debugging

Currently, the choice between masterd and conf/queryd is made
statically, based on whether a query is converted or not and whether
split queries are enabled. This makes it hard to test and develop
these new queries, so this patch adds an override for the socket.

The choice for going with two hardcoded strings and arbitrary socket
fallback is done so that it's easy to use this in virtual clusters as
well.

Additionally, the patch improves the error message on failed connects
when we use arbitrary sockets; before, it always "blamed" confd for
non-master sockets.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoImprove RAPI documentation on users and options
Michael Hanselmann [Thu, 21 Feb 2013 10:48:59 +0000 (11:48 +0100)]
Improve RAPI documentation on users and options

- Document fields in “rapi/users” file in the order they appear
  (username, password, options)
- Mention new “--require-authentication” option
- Clarify use of “write” on “GET” method

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agosphinx_ext: Drop text map for RAPI permissions
Michael Hanselmann [Thu, 21 Feb 2013 10:47:39 +0000 (11:47 +0100)]
sphinx_ext: Drop text map for RAPI permissions

Other parts of the documentation directly refer to the constants through
“pyeval”. There's no need for this map as it's just additional work to
maintain.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoRAPI: Add flag to require authentication
Michael Hanselmann [Wed, 20 Feb 2013 17:01:56 +0000 (18:01 +0100)]
RAPI: Add flag to require authentication

Most RAPI resources do not require authentication for the “GET” method.
In some setups it can be desirable to always require authentication.
This patch adds a command line parameter to always require it.

Some unrelated minor typos in the “ganeti-rapi” man page are also fixed.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Thu, 21 Feb 2013 08:30:21 +0000 (09:30 +0100)]
Describe format of the monitoring agent HTTP queries

The previous patch was incomplete when erroneously pushed.

This patch, originally intended as part of the previous one, fixes it.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Tue, 19 Feb 2013 14:52:35 +0000 (15:52 +0100)]
Describe format of the monitoring agent HTTP queries

Update the monitoring agent design document adding the format of the HTTP
queries that will have to be used to query the monitoring agent.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRemove test of obsolete getNetworkUuid method
Helga Velroyen [Wed, 20 Feb 2013 12:07:02 +0000 (13:07 +0100)]
Remove test of obsolete getNetworkUuid method

This will remove the tests for the getNetworkUuid method.
The method will be obsolete after the changes regarding
identification of networks by UUID and not name are merged
into master. Will send another patch for removing the
actual method.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoSwitch the RPC module over to the multi interface
Iustin Pop [Wed, 20 Feb 2013 11:14:57 +0000 (12:14 +0100)]
Switch the RPC module over to the multi interface

This replaces the very-basic parMap of IO actions (fully serialised,
as parMap won't work here), to the multi interface.

This makes a simple "time gnt-node list" on a 6-node cluster go from
3.2s to ~0.9s, and allows even better parallelisation - before,
curlGetString was blocking, whereas the new interface does allow some
interleaving.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd a Ganeti-specific implementation of Curl Multi
Iustin Pop [Wed, 20 Feb 2013 10:49:07 +0000 (11:49 +0100)]
Add a Ganeti-specific implementation of Curl Multi

As we want to be able to run queries against multiple nodes in
parallel, and furthermore in parallel with other work, we need to
implement the Curl Multi interface (see libcurl-multi(3)).

This patch adds a Ganeti-specific such implementation, to be used
until upstream Curl bindings provide it. The implemented interface
(there are two 'multi' interfaces) is the older curl_multi_perform(3).

It has one downside (which is also, somewhat, and advantage): we use
polling instead of more properly select() or poll. This is due to how
waiting for FDs is implemented in Haskell: currently, it's not
possible to wait for multiple FDs at once nicely, so we'd have to fork
many threads for each FD to be watched, or alternatively one could use
FFI select, but that would block the entire runtime.

With the current poll method, the implementation achieves consistent
~100 RPC/s per second (with 10 multi interfaces running in parallel,
each with 10 easy handles), and over ~1 hour of runtime the memory
usage is stable, so memory allocation/deallocation (manual when
dealing with FFI) _seems_ to be well handled.

Future optimisations could be to move to curl_multi_socket_action(3),
which might allow better integration with the Haskell runtime.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd two utility functions for handling Either lists
Iustin Pop [Tue, 19 Feb 2013 13:26:48 +0000 (14:26 +0100)]
Add two utility functions for handling Either lists

These two functions permit operating in bulk on only the Left or Right
values in the original list, then reassembling the list back in the
original order.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoSimplify RPC error cases
Iustin Pop [Fri, 30 Nov 2012 01:24:56 +0000 (02:24 +0100)]
Simplify RPC error cases

This patch removes the node from the RPC error constructurs
CurlLayerError and OfflineNodeError. The rationale is that we anyway
return tuples (node, result), and removing this duplication allows
simplified signatures/calls in the execution of RPC calls.

Note: this was sent before as well, resending on top of current codebase.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoReduce duplication of curl options computation
Iustin Pop [Fri, 30 Nov 2012 01:36:57 +0000 (02:36 +0100)]
Reduce duplication of curl options computation

Some curl option are request-specific, but not node specific: e.g. rpc
timeout, etc. The patch changes the HttpClientRequest type so that we
can pre-seed such options, instead of rebuilding the list in each
individual request execution.

Note: this was sent before and LGTMed, but on a different codebase, so
resending an updated version.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoSwitch the curl bindings from optional to required
Iustin Pop [Fri, 15 Feb 2013 13:08:17 +0000 (14:08 +0100)]
Switch the curl bindings from optional to required

Currently, we support curl being optional via some sporting exercises:
ifdefs in the code, data types that represent 'Curl is disabled'
state, etc. However, with the future work on RPC, we would have to
even make the dependencies list conditional on it, etc. This is too
much work, when the curl library is included even in stable
distributions.

This patch changes curl from option to required, the same as the other
base libraries.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoqa_config.AcquireNode: Use sort key function
Michael Hanselmann [Wed, 6 Feb 2013 13:04:47 +0000 (14:04 +0100)]
qa_config.AcquireNode: Use sort key function

Use a sort key function instead of using a comparing function (“cmp=…”).
The latter is not supported in Python 3 and using a sort key function is
easier.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoqa_config: Add __repr__ for instance/node classes
Michael Hanselmann [Wed, 6 Feb 2013 13:04:43 +0000 (14:04 +0100)]
qa_config: Add __repr__ for instance/node classes

Having a readable representation makes debugging easier.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoTest "GetNodeInfo" for Xen hypervisor
Michael Hanselmann [Wed, 6 Feb 2013 13:56:03 +0000 (14:56 +0100)]
Test "GetNodeInfo" for Xen hypervisor

This patch adds unit tests for success and failure of the “GetNodeInfo”
method for the Xen hypervisor abstractions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoQA: Add validation for cluster name
Michael Hanselmann [Wed, 6 Feb 2013 11:40:52 +0000 (12:40 +0100)]
QA: Add validation for cluster name

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Acquire instance via method
Michael Hanselmann [Wed, 6 Feb 2013 10:15:35 +0000 (11:15 +0100)]
QA: Acquire instance via method

Also make “used” a property.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoMerge branch 'devel-2.7'
Michael Hanselmann [Wed, 20 Feb 2013 13:05:22 +0000 (14:05 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  NEWS: Fix the fix in commit 82b6f9a
  NEWS: Fix release date for 2.7.0 beta1
  Minor fixes regarding nic.network change
  Fix issue 378
  NEWS: Mention multi-alloc and fix typo
  Add cfgupgrade for changing nic.network to uuid
  Remove useless code in backend for network hooks
  Show network name and not uuid in instance info
  Add IQ_NETWORKS in query tests
  Implement network locking in Instance queries
  Changes in query to support nic.network as uuid
  Modify query LUs to supoprt nic.network as uuid
  Add GetInstanceNetworks() config method
  cmdlib changes to support nic.network as uuid
  Make network config methods take uuid as argument
  Document possible hypervisor bug in serial_console
  Update man pages wrt ExtStorage

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoNEWS: Fix the fix in commit 82b6f9a
Michael Hanselmann [Wed, 20 Feb 2013 12:41:59 +0000 (13:41 +0100)]
NEWS: Fix the fix in commit 82b6f9a

February 2, 2013 was a Wednesday, not a Thursday.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoNEWS: Fix release date for 2.7.0 beta1
Michael Hanselmann [Wed, 20 Feb 2013 11:43:47 +0000 (12:43 +0100)]
NEWS: Fix release date for 2.7.0 beta1

Commit b6ad806f used a wrong date.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoBuild table with access permissions for RAPI resources
Michael Hanselmann [Thu, 14 Feb 2013 15:20:06 +0000 (16:20 +0100)]
Build table with access permissions for RAPI resources

Sometimes it can be difficult to determine the access permissions needed
for a certain RAPI resource without looking at code. This table, added
at the end of “rapi.rst”, shows all resources and the permissions needed
for their methods.

Another nice side-effect of this change is that there's an automatic
cross-checking between implemented resources and methods and the
documentation.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAllow generating different RAPI resource lookup tables
Michael Hanselmann [Tue, 12 Feb 2013 12:38:53 +0000 (13:38 +0100)]
Allow generating different RAPI resource lookup tables

Until now the RAPI resource table returned by
“rapi.connector.GetHandlers” always uses fixed strings or compiled
regular expressions as dictionary keys. Now that a table of all RAPI
resources (and their access rights) should be written for the
documentation, a plain string version of the URIs must be available. The
compiled pattern might contain escape sequences and is not suitable.

This patch changes “GetHandlers” to accept a hook function which is used
to translate non-static resource URIs such as “/2/jobs/[job_id]/wait”.
The default implemention retains the original behaviour by translating
to compiled regular expressions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoHRoller design updates
Guido Trotter [Fri, 15 Feb 2013 16:44:28 +0000 (17:44 +0100)]
HRoller design updates

- Specify that there will be options for selecting nodes by at least
  nodegroups and tags, rather than just individually.
- Specify a better handling for non-redundant instances (eg. plain or
  file) which today are simply ignored
- Specify that the rolling maintenance behavior is triggered by
  instances being up, but also overridable
- Remove execution of rolling maintenances altogether, as it is deemed
  unsafe in the current version, and move it to future work, discuss the
  requirements that were pointed out for it to be safe.

Cosmetic:
- Fix numbered list, which were rendered incorrectly in the HTML version

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoMinor fixes regarding nic.network change
Dimitris Aragiorgis [Tue, 19 Feb 2013 16:28:42 +0000 (18:28 +0200)]
Minor fixes regarding nic.network change

Make LookupNetwork() return None in case target is None. This fixes
Issue 380. Rapi passes network=None and the lookup should not fail.

Make network client aware of new nic.network.gnt-network info shows
the IPs of each instance inside the network.  It parses nic.networks
field of QueryInstances() output, which now is a list of uuids an
not names.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agobaserlib: Make "_OPCODE_ATTRS" public
Michael Hanselmann [Thu, 14 Feb 2013 16:44:25 +0000 (17:44 +0100)]
baserlib: Make "_OPCODE_ATTRS" public

"_OPCODE_ATTRS" will also be used in the Sphinx extension.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMakefile: Add dependencies
Michael Hanselmann [Thu, 14 Feb 2013 16:10:41 +0000 (17:10 +0100)]
Makefile: Add dependencies

The RAPI documentation now depends on “connector.py” (handler
registration) and “rlib2.py” (access permissions).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRAPI documentation: Add link targets
Michael Hanselmann [Thu, 14 Feb 2013 15:19:45 +0000 (16:19 +0100)]
RAPI documentation: Add link targets

A newly added table of RAPI access permissions will link to all
resources and their supported methods. For this reason link targets need
to be added.

The GET method on “/2/nodes/[node_name]” was not separately mentioned.
This is also fixed.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix issue 378
Dimitris Aragiorgis [Tue, 19 Feb 2013 14:45:30 +0000 (16:45 +0200)]
Fix issue 378

In case a NIC is not inside a network then netinfo None. Thus
netinfo["name"] fails.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoHelper to retrieve access permissions for RAPI resource
Michael Hanselmann [Wed, 13 Feb 2013 12:43:33 +0000 (13:43 +0100)]
Helper to retrieve access permissions for RAPI resource

Merge similar code into a helper function.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoSphinx extension: Module-level constant for tab width
Michael Hanselmann [Thu, 14 Feb 2013 15:17:52 +0000 (16:17 +0100)]
Sphinx extension: Module-level constant for tab width

Use a module-level constant for the tab width.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoRAPI documentation: Assertion for console fields
Michael Hanselmann [Thu, 14 Feb 2013 15:38:10 +0000 (16:38 +0100)]
RAPI documentation: Assertion for console fields

Assert that the documented fields are equal to those in the actual
object.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoStatus change reason support for Reboot
Michele Tartara [Tue, 12 Feb 2013 09:21:03 +0000 (09:21 +0000)]
Status change reason support for Reboot

Add support to the Reboot command for specifying the reason for the last
status change.

Some features are implemented as functions, even if used only once, because
they will be used by the future patches introducing reason support for all
the others commands able to alter the state of instances.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoInfrastructure for specifying instance status change reason
Michele Tartara [Tue, 12 Feb 2013 09:15:46 +0000 (09:15 +0000)]
Infrastructure for specifying instance status change reason

This patch introduces some infrastructural modifications that will be used by
the following commits to implement the support for specifying the reason for
the last status change of an instance.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoNEWS: Mention multi-alloc and fix typo
Michael Hanselmann [Thu, 14 Feb 2013 15:55:07 +0000 (16:55 +0100)]
NEWS: Mention multi-alloc and fix typo

As far as I could see, the ability to allocate multiple instances via
RAPI was not mentioned at all. A superfluous word is also removed.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUnit tests for Query/Network.hs
Helga Velroyen [Thu, 7 Feb 2013 17:30:04 +0000 (18:30 +0100)]
Unit tests for Query/Network.hs

This patch adds a couple of unit tests for Query/Network.hs.
Note that they'll need to be adapted, once issue 362 is addressed.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoMake Confd client usable for testing
Michele Tartara [Tue, 5 Feb 2013 09:43:16 +0000 (09:43 +0000)]
Make Confd client usable for testing

Allow the Confd client to be able to connect to an arbitrary server
instead of just the real one running on a cluster.

This is meant to be used for testing.

If a data collector using the Confd client is tested with shelltest, it will
need to receive through the CLI the address and port of the server, and also the
FQDN for which information is being requested. In normal usage it will likely be
the name of the node the data collector is running on, but for testing we need a
way to explicitly specify it so that it corresponds to the one used inside the
configuration files that the test confd server is reading.

So, optConfdAddr and optConfdPort and optNode are provided by this patch, even
if not used, because they are an important part of the modifications for making
the Confd client testable.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoAdd Haskell parser for "xm uptime"
Michele Tartara [Wed, 6 Feb 2013 08:24:49 +0000 (09:24 +0100)]
Add Haskell parser for "xm uptime"

In order to fetch precise information about the uptime of the VMs
running in Xen, we need to analyze the output of the "xm uptime" command.

This commit adds the parser to do that, and its tests.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoAdd Haskell parser for "xm list --long"
Michele Tartara [Fri, 18 Jan 2013 10:10:47 +0000 (11:10 +0100)]
Add Haskell parser for "xm list --long"

In order to fetch precise information about the status of the VMs running in
Xen, we need to analyze the output of the "xm list --long" command.

This commit adds the parser to do that, and its tests.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoAdd request type to Confd server for getting instance list
Michele Tartara [Thu, 10 Jan 2013 08:22:57 +0000 (09:22 +0100)]
Add request type to Confd server for getting instance list

Add to Confd server a new request type (and its implementation) to ask for
the list of instances in a node.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoUpdate monitoring agent report format
Michele Tartara [Thu, 10 Jan 2013 13:19:34 +0000 (14:19 +0100)]
Update monitoring agent report format

This commit expands the monitoring agent design document improving the
description of the general report file format.

There can be two kinds of data collectors (performance and status collectors).

Every collector can now be part of a category of collectors (such as
storage, instance, daemon, hypervisor, etc.) that defines a minimum basic
structure that has to be common to all the collectors part of the same class.

Also, such basic structure is defined for all the currently envisioned class
of collectors.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd cfgupgrade for changing nic.network to uuid
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:40 +0000 (15:19 +0200)]
Add cfgupgrade for changing nic.network to uuid

This gets all network info from config_data and parses
all instances and their NICs and makes the substitution.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRemove useless code in backend for network hooks
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:39 +0000 (15:19 +0200)]
Remove useless code in backend for network hooks

In backend NICs arrive with netinfo filled. If nic.network is not None
nic.netinfo is not too. Thus all the info is derived from HooksDict()
and nic.network must not be checked.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoShow network name and not uuid in instance info
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:38 +0000 (15:19 +0200)]
Show network name and not uuid in instance info

This was before the case too. Now is bit trickier because nic.network
is uuid. Info must derive from nic.netinfo.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoAdd IQ_NETWORKS in query tests
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:37 +0000 (15:19 +0200)]
Add IQ_NETWORKS in query tests

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoImplement network locking in Instance queries
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:36 +0000 (15:19 +0200)]
Implement network locking in Instance queries

This is needed in case more info than each nic's network uuid is to
be returned. We need to lock networks to get valid data. For now
only the name is returned as an extra field. All other can be added
with trivial effort.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoChanges in query to support nic.network as uuid
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:35 +0000 (15:19 +0200)]
Changes in query to support nic.network as uuid

Queries now return the network uuid as well as it's name. Here we
only use info provided be LUInstanceQueryData context.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoModify query LUs to supoprt nic.network as uuid
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:34 +0000 (15:19 +0200)]
Modify query LUs to supoprt nic.network as uuid

Make _InstanceQuery gather all network info related to instance's
NICs and in case of NETQ_INST in _NetworkQuery get all network
uuids directly from nic.network

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoAdd GetInstanceNetworks() config method
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:33 +0000 (15:19 +0200)]
Add GetInstanceNetworks() config method

This will be needed for Instance Queries. It walks through the
instance's NICs and returns a list network uuids that the NICs
are attached to.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agocmdlib changes to support nic.network as uuid
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:32 +0000 (15:19 +0200)]
cmdlib changes to support nic.network as uuid

Refactor Instance related LUs to support nic.network as
a uuid. This removes all the unnecessary invocations to
LookupNetwork().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoMake network config methods take uuid as argument
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:31 +0000 (15:19 +0200)]
Make network config methods take uuid as argument

This will be needed in the following patches where nic.network
will refer to network's uuid and not name.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoDocument possible hypervisor bug in serial_console
Guido Trotter [Fri, 15 Feb 2013 14:39:06 +0000 (15:39 +0100)]
Document possible hypervisor bug in serial_console

This is described in Issue 83.

Update both the install guide and the gnt-instance manpage.
In the install guide move another KVM specific example inside a new KVM
admonition for the hypervisor parameters section.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoUpdate man pages wrt ExtStorage
Constantinos Venetsanopoulos [Thu, 14 Feb 2013 14:38:52 +0000 (16:38 +0200)]
Update man pages wrt ExtStorage

 * ganeti-extstorage-interface: add examples
 * gnt-instance: document the “ext” template
 * remove a few double spaces

Also link to its design doc in the design-2.7 doc

Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>

11 years agoDesign correct reporting of storage free space
Guido Trotter [Wed, 15 Aug 2012 15:50:30 +0000 (16:50 +0100)]
Design correct reporting of storage free space

This is a long standing bug in Ganeti. Add a small design on how we plan
to fix this for Ganeti 2.7.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoMerge branch 'devel-2.7'
Iustin Pop [Fri, 15 Feb 2013 11:53:30 +0000 (12:53 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  Rename lib/objectutils to outils.py
  Fix typo in gnt-group manpage
  Fix wrong type in a docstring of the RAPI subsystem
  Finish the remote→restricted commands rename
  Enable use of the priority option in hbal
  Add CLI-level option to override the priority
  Add functions to parse CLI-level format of priorities
  Add a function to change an OpCode's priority
  Make hbal opcode annotation more generic
  Add unit tests for RADOSBLockDevice
  Fix rbd showmapped output parsing
  Change default xen root path to /dev/xvda1
  Removes check for conflicts from NetworkDisconnect
  If _UnlockedLookupNetwork() fails raise error
  Force conflicts check in LUNetworkDisconnect

Also updated objects.py with more outils renames.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRevert "Disable live-RPC queries under split query"
Iustin Pop [Thu, 14 Feb 2013 12:39:18 +0000 (13:39 +0100)]
Revert "Disable live-RPC queries under split query"

This reverts commit fb251c2c4c582ec0d6c00a6f6c5e134ed5196e03. On the
master branch we want to continue to have them enabled.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRename lib/objectutils to outils.py
Iustin Pop [Fri, 15 Feb 2013 09:29:47 +0000 (10:29 +0100)]
Rename lib/objectutils to outils.py

Back when this was introduced, I mentioned that it breaks heavily tab
completion (ob<TAB> doesn't work anymore), but at that moment I didn't
have a suggestion what to name it. I think outils is good and short
enough, and doesn't conflict with anything else, so here it goes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd hroller design to Makefile and design-drafts
Guido Trotter [Fri, 15 Feb 2013 09:32:10 +0000 (10:32 +0100)]
Add hroller design to Makefile and design-drafts

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoHroller design doc
Guido Trotter [Fri, 8 Feb 2013 13:24:17 +0000 (14:24 +0100)]
Hroller design doc

Hroller in 2.7 was implemented (as an experiment) but never explicitly
designed. This design mentions the current functionality, and explains
the changes that will happen for the next release to support live
maintenance scheduling (rolling reboot).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoFix typo in gnt-group manpage
Ben Lipton [Wed, 13 Feb 2013 17:21:07 +0000 (12:21 -0500)]
Fix typo in gnt-group manpage

The --ipol-disk-templates parameter should actually be
--ipolicy-disk-templates.

Signed-off-by: Ben Lipton <ben.lipton@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix wrong type in a docstring of the RAPI subsystem
Michele Tartara [Tue, 12 Feb 2013 15:40:16 +0000 (15:40 +0000)]
Fix wrong type in a docstring of the RAPI subsystem

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Set disk template directly via instance object
Michael Hanselmann [Tue, 5 Feb 2013 16:43:34 +0000 (17:43 +0100)]
QA: Set disk template directly via instance object

Use a method on the instance object instead of going through
“qa_config.GetInstanceTemplate”. This provides for better encapsulation.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoRemove qa_config.GetInstanceNicMac
Michael Hanselmann [Tue, 5 Feb 2013 16:33:39 +0000 (17:33 +0100)]
Remove qa_config.GetInstanceNicMac

Call the wrapped instance method directly.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Use constants for disk templates
Michael Hanselmann [Tue, 5 Feb 2013 16:31:12 +0000 (17:31 +0100)]
QA: Use constants for disk templates

Disk template names shouldn't be hardcoded.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoFix a merge issue in 3c296f56
Bernardo Dal Seno [Tue, 12 Feb 2013 13:53:44 +0000 (14:53 +0100)]
Fix a merge issue in 3c296f56

Lines removed in devel-2.7 (250a9404) weren't removed in the merge with
master.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoFinish the remote→restricted commands rename
Iustin Pop [Fri, 8 Feb 2013 13:42:36 +0000 (14:42 +0100)]
Finish the remote→restricted commands rename

The documentation still points to /etc/ganeti/remote-commands,
although the code is already using restricted-command. Update the
documentation and a few docstrings accordingly.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoEnable use of the priority option in hbal
Iustin Pop [Fri, 8 Feb 2013 12:43:01 +0000 (13:43 +0100)]
Enable use of the priority option in hbal

This patch adds the option to hbal, and uses it to tweak the submitted
jobs. There are also two small shelltests for testing the parsing.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd CLI-level option to override the priority
Iustin Pop [Fri, 8 Feb 2013 12:23:50 +0000 (13:23 +0100)]
Add CLI-level option to override the priority

This just defined the new priority, with the same name as the Python one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd functions to parse CLI-level format of priorities
Iustin Pop [Fri, 8 Feb 2013 12:14:26 +0000 (13:14 +0100)]
Add functions to parse CLI-level format of priorities

The current serialisation format for submit priorities is
integer-based, same as the opcode json serialisation. But for CLI
level, we need to support a string-based format, so we add functions
to parse and format this representation.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd a function to change an OpCode's priority
Iustin Pop [Fri, 8 Feb 2013 11:22:24 +0000 (12:22 +0100)]
Add a function to change an OpCode's priority

This simply updates the metaopcode submit priority.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMake hbal opcode annotation more generic
Iustin Pop [Fri, 8 Feb 2013 11:12:56 +0000 (12:12 +0100)]
Make hbal opcode annotation more generic

Currently, hbal code always uses annotateOpCode function, which means
we would have to pass the options data to all function in the call
chain if we wanted to make this more flexible.

By abstracting the type of the annotator and passing it as an argument
to the function, we can be more flexible.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd unit tests for RADOSBLockDevice
Stratos Psomadakis [Tue, 12 Feb 2013 12:07:13 +0000 (14:07 +0200)]
Add unit tests for RADOSBLockDevice

Add unit tests for the RADOSBlockDevice JSON output parsing function,
and modify the unit tests for the plain output parsing function to
work with the new code.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix rbd showmapped output parsing
Stratos Psomadakis [Fri, 8 Feb 2013 16:36:34 +0000 (18:36 +0200)]
Fix rbd showmapped output parsing

'rbd showmapped' output formatting differs between older and newer versions of
the ceph tools. Try to use json output formatting if available (currently
available only in the ceph master branch). For bobtail, argonaut and older
releases fallback to manually parsing the 'rbd showmapped' output, handling the
differences in the output format for each rbd version correctly.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoChange default xen root path to /dev/xvda1
Guido Trotter [Tue, 12 Feb 2013 09:39:16 +0000 (10:39 +0100)]
Change default xen root path to /dev/xvda1

All recent-enough versions of linux see the xen paravirtual device as
/dev/xvd*.

This doesn't break old installations, as the default is only used on new
clusters.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoRemoves check for conflicts from NetworkDisconnect
Helga Velroyen [Wed, 30 Jan 2013 16:56:20 +0000 (16:56 +0000)]
Removes check for conflicts from NetworkDisconnect

This removes the check for conflicts from the Haskell
version of the OpCode NetworkDisconnect. This alignes
the Haskell code with the patch
"Force conflicts check in LUNetworkDisconnect" (which
is currently under review). I will submit these patches
together then.

This is a cherry-pick of commit 0ae4b35.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoIf _UnlockedLookupNetwork() fails raise error
Helga Velroyen [Wed, 30 Jan 2013 16:35:10 +0000 (17:35 +0100)]
If _UnlockedLookupNetwork() fails raise error

Make _UnlockedLookupNetwork() raise OpPrereqError (instead of returning
None) in case it does not find the requested network. Remove useless and
duplicate code such as:

if net_uuid is None:
  raise...

This is a cherry-pick of commit 1cce2c4.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>