core:Validate attach disk to contained VM (#833077)

https://bugzilla.redhat.com/833077

Fix validation for attaching disk to the same VM.
Shareable disk can not be attached to the same VM (same for regular
disk).

Change-Id: Ia653df7c843630f0adb91cb032cf4e1eb952f085
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>
core+ui: allow vm/template/pool/disk name to contain period

This patch allows the name of vm/disk/pool/template to contain dots.

Change-Id: I17dc34fa4ed63604473bd53a7debf2ab4f68df84
Signed-off-by: Oved Ourfali <oourfali@redhat.com>
webadmin: IscsiStorageView tabs style modifications

https://bugzilla.redhat.com/833380

Fixed tabs style in IscsiStorageView

Change-Id: I34387d610e77df8ca0dff2f0d41fb6d3eb273225
Signed-off-by: Daniel Erez <derez@redhat.com>
webadmin: disks tab - disable template disk removal

Disk template disk removal from disks main tab

Change-Id: I30607571953ac7faa1e53f4662eec5b567ff4725
Signed-off-by: Daniel Erez <derez@redhat.com>
engine: Avoid PM/storage alerts for GlusterOnly clusters

https://bugzilla.redhat.com/829842
https://bugzilla.redhat.com/830820

Bugs:
 - Activation of server triggers "Failed to connect host to storage servers" event
 - Power Management related events/alerts should be removed

This was happening because various class level boolean variables indicating errors related to
storage pool and fencing are set to false by default, and trigger corresponding audit logs/
events when getAuditLogTypeValue() is called. This should not happen if the host belongs to
a cluster that does not support virtualization e.g. gluster cluster.

Also modified VdsCommand to generate the power management alert only when virt service
is enabled on the cluster.

Change-Id: I22d93df0cf6b2594d7eabf972c038baf893eccdf
Signed-off-by: Shireesh Anjal <sanjal@redhat.com>
core: Deprecate StringHelper

The usage of StringHelper methods is discurage since its not optimal (uses StringBuffer insead of Builder)
and has already a proven, widely used twin made by apache, org.apache.commons.lang.StringUtils

Change-Id: Ibe8512c55ad0a7f1a9622533625db5d75c5f982b
Signed-off-by: Roy Golan <rgolan@redhat.com>
core: we are able to add a disk during create snapshot (#833787)

https://bugzilla.redhat.com/833787

Adding missing check for vm during snapshot at add disk and attach disk operation

Change-Id: Ifffbdc4b20e4a5cdfbff1cb7c8a0a8dcb9a79c6a
Signed-off-by: MIchael Kublin <mkublin@redhat.com>
engine: Removing the use of deprecated RefObject class.

This is the first patch in the series.

Change-Id: Ia9458cbe834b5778eed656ac2107bc342246b002
Signed-off-by: Sharad Mishra <snmishra@linux.vnet.ibm.com>
core: cleanup VdsSelector

- java.util FQN replaced with imports
- ArrayList replaced with List where applicable
- does no longer use the ctr to init privateRunVdssList, gets an
  instance by initializer
- setRunVdssList was never called, removed privateRunVdssList can be
  final

Change-Id: I14f1c39dc85117266b75f09bf44fa063469c38d2
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
webadmin: change default gateway title

In edit management network form- from host->interface->
edit management network or from setup networks
there two colons after Default Gateway title

Change-Id: I15702959760c69b62c65ba4137c5e9d7c0fa51c3
Signed-off-by: Alona Kaplan <alkaplan@redhat.com>
userportal: Exception when no items in basic view

If there are no VMs or Pools, the UP's basic view throws an
exception during the load. It is because the
MainTabBasicListPresenterWidget.selectDefault expects,
that at least one VM or Pool is visible for the user.

Solved by avoiding this expectation.

Change-Id: I31b5acd4402aed775d57f4e6ba3ccb5914a93c75
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>
userportal: Extended view/Basic view visibility fixes

There where two problems with determining, if the Extended view
should be shown or not:
1: The Everyone has a QuotaConsumer role which enabled everyone
   to see the Extended view.
   Fixed by ignoring the Everyone QuotaConsumer when deciding
   if show or not show the extended view
2: After logout/login as user with different role, the visibility
   of the header buttons (Basic, Extended) was not updated.
   Fixed by moving the code which refreshes this from
   HeaderPresenterWidget.onBind to HeaderPresenterWidget.onReset
   because the HeaderPresenterWidget is a singleton.

This patch also contains the creating of the enum named
ApplicationGuids which contains some well known values from
ad_groups and roles tables and also the refactoring of places
which used this values directly to use them from the enum.

Change-Id: I16ec262e7e5b46ccfdba28d091726d8368cae054
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>
userportal: Console popup dialog fixes

Previously, the ConsolePopup was implemented independently
of the standard popup architecture, because the popup
did not have a model class. This caused several problems,
such as the enter/escape binding, title of the popup and
most recently after the console popup has been closed, no
other popups could be opened.

This patch solved this by refactoring the console popup
to fit into the standard popup architecture with it's
own model (UserPortalConsolePopupModel) and commands
for save and close.

This patch also includes the adding the method
beforeCommandExecuted to AbstractModelBoundPopupPresenterWidget
which is executed before every command on that popup
is executed.

Change-Id: I7b5a91a67c703bee7536b3ac5158e1eb35275ebf
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>
core: Fixing unit test

The following patch will fix mistakenly broken unit test

Change-Id: I034fd60378d11b869619de5de6fe2bb16d558752
Signed-off-by: Michael Kublin <mkublin@redhat.com>
restapi: make /from/ parameter at /events to be described as matrix param

Change-Id: Icab86f507aec0f151bf14673d50d69b075a28a41
Signed-off-by: Michael Pasternak <mpastern@redhat.com>
core: Fixed disk name in add disk event (819288)

https://bugzilla.redhat.com/819288

Disk name in add disk to VM event appeared as "DiskAlias"
fixed it to show the actual

Change-Id: I21f46c152005826d3a4ea45da246c8380276fb50
Signed-off-by: Tal Nisan <tnisan@redhat.com>
core: creating pool when there is not enough space

Adding a new configuration variable : VmPoolMaxSubsequentFailures (defaulted to 3)
This limits the number of subsequent failures in vm creation in a pool to the configured number
After reaching this number, vm creation loop will stop generating a audit log messages determining
the reason of failure and how many vms from requested were created.
Keep in mind that we count only subsequent failures. The reason for that is that we may have a
temporary problem on a certain VM, so if a VM creation is failed we continue the loop and advance
the subsequent failures counter and if a VM creation succeeded we reset this counter.

Change-Id: I76d485c85e609f4cbea7e2fd37c90937e792c00d
Signed-off-by: Eli Mesika <emesika@redhat.com>
engine: Refactored network.java to Network.java

'network' does not follow java class naming convention. It has been renamed
to 'Network'. There was already a class named 'Network', so to avoid
any confusion, we used fully qualified name where there was a conflict.

Change-Id: Id75442225195970496a7516aa9b9c63f42f610db
Signed-off-by: Sharad Mishra <snmishra@linux.vnet.ibm.com>