Re: [Glpi-dev] Fwd: [glpi] walid | rev 17223 - [0.83] see #3289 simplier way to sychronize vms (thanks Remi)

2012-01-28 Thread Eltharin
Bonjour,

 

Avec le dernier c’est résolu.

 

Cordialement,

 

 

De : glpi-dev-boun...@gna.org [mailto:glpi-dev-boun...@gna.org] De la part de 
MoYo
Envoyé : jeudi 26 janvier 2012 17:04
À : glpi-dev@gna.org
Objet : Re: [Glpi-dev] Fwd: [glpi] walid | rev 17223 - [0.83] see #3289 
simplier way to sychronize vms (thanks Remi)

 

Le 26/01/2012 17:01, Eltharin a écrit : 

Bonjour,

 

Concernant la 0.83, voici un retour : 

 

Sous configuration / authentification / autres, le formulaire pointe vers 
auth.form.php qui affiche une erreur 404.

 

J’ai fait un copié-collé de la page auth.other.php et ça marche pour info je 
n’ai pas trouvé ou le changé dans le formulaire.

 

Cordialement,

 

Bonjour,

merci du retour, je crois que ce problème est déjà corrigé.
Pouvez vous tester avec le dernier tarball ?

Cordialement,

Julien Dombre

___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev


[Glpi-dev] Fwd: [glpi] walid | rev 17223 - [0.83] see #3289 simplier way to sychronize vms (thanks Remi)

2012-01-26 Thread Walid nouh

Bonjour,

Remi a très justement faire remarquer que j'ai oublié d'ajouter les 
indexes sur la table glpi_computervirtualmachines en 0.80.

Est-ce que je peux ajouter les indexes pour la 0.83 ?

Bonne journée à tous,
Walid.

 Original Message 
Subject: 	[glpi] walid | rev 17223 - [0.83] see #3289 simplier way to 
sychronize vms (thanks Remi)

Date:   Thu, 26 Jan 2012 15:57:22 +0100
From:   nore...@indepnet.net
To: undisclosed-recipients:;



walid has commited revision 17223 for the GLPI-PROJECT project.

Comments : [0.83] see #3289 simplier way to sychronize vms (thanks Remi)

Please take a moment to review their checkin : 
https://forge.indepnet.net/repositories/revision/glpi/17223



You have received this notification because you have either subscribed 
to it, or are involved in it.
To change your notification preferences, please click here: 
https://forge.indepnet.net/my/account


Index: branches/0.83-bugfixes/inc/ocsserver.class.php
===
--- branches/0.83-bugfixes/inc/ocsserver.class.php	(revision 17222)
+++ branches/0.83-bugfixes/inc/ocsserver.class.php	(revision 17223)
@@ -4327,7 +4327,7 @@
 
static function updateVirtualMachines($computers_id, $ocsid, $ocsservers_id, $cfg_ocs, $import_vm,
  $dohistory) {
-  global $DBocs, $DB;
+  global $DBocs;
 
   // No VM before OCS 1.3
   if ($cfg_ocs['ocs_version']  self::OCS1_3_VERSION_LIMIT) {
@@ -4341,62 +4341,40 @@
 FROM `virtualmachines`
 WHERE `HARDWARE_ID` = '$ocsid';
   $result = $DBocs-query($query);
-  
+
   $virtualmachine = new ComputerVirtualMachine();
   if ($DBocs-numrows($result)  0) {
  while ($line = $DBocs-fetch_array($result)) {
 $line = Toolbox::clean_cross_side_scripting_deep(Toolbox::addslashes_deep($line));
-$vm['name'] = $line['NAME'];
-$vm['vcpu'] = $line['VCPU'];
-$vm['ram']  = $line['MEMORY'];
-$vm['uuid'] = $line['UUID'];
-$vm['computers_id'] = $computers_id;
+$vm['name'] = $line['NAME'];
+$vm['vcpu'] = $line['VCPU'];
+$vm['ram']  = $line['MEMORY'];
+$vm['uuid'] = $line['UUID'];
+$vm['computers_id'] = $computers_id;
+
 $vm['virtualmachinestates_id']  = Dropdown::importExternal('VirtualMachineState',
$line['STATUS']);
 $vm['virtualmachinetypes_id']   = Dropdown::importExternal('VirtualMachineType',
$line['VMTYPE']);
 $vm['virtualmachinesystems_id'] = Dropdown::importExternal('VirtualMachineType',
$line['SUBSYSTEM']);
-//VM already exists on this computer
-if (in_array(stripslashes($line[ID]), $import_vm)) {
+
+if (!in_array(stripslashes($line[UUID]), $import_vm)) {
$virtualmachine-reset();
-   $vm['id'] = $line['ID'];
-   $virtualmachine-update($vm);
-   
-   //vm processed, remove it from import_vm
-   $id = array_search(stripslashes($line[ID]), $import_vm);
-   unset($import_vm[$id]);
+   if (!$dohistory) {
+  $vm['_no_history'] = true;
+   }
+   $id_vm = $virtualmachine-add($vm);
+   if ($id_vm) {
+  self::addToOcsArray($computers_id, array($id_vm = $line['UUID']), import_vm);
+   }
 } else {
-   //VM doesn't exists on the host, but may exist on another one
-   $query = SELECT `id`, `computers_id` FROM `glpi_computervirtualmachines`  .
-   WHERE `uuid`='.$line['UUID'].';
-   $result_vms = $DB-query($query);
-   if ($DB-numrows($result_vms)  0) {
-  $old_computers_id = $DB-result($result_vms, 0, computers_id);
-  $id   = $DB-result($result_vms, 0, id);
-  //If vm has changed of host
-  if ($old_computers_id != $computers_id) {
- self::deleteInOcsArray($old_computers_id, $id, import_vm);
- self::addToOcsArray($computers_id, array($id = $line['ID']), import_vm);
-  } else {
- //vm ID has changed in OCS, update import_vm
- self::deleteInOcsArray($computers_id, $id, import_vm);
- self::addToOcsArray($computers_id, array($id = $line['ID']), import_vm);
-  }
-  unset($import_vm[$id]);
-   

Re: [Glpi-dev] Fwd: [glpi] walid | rev 17223 - [0.83] see #3289 simplier way to sychronize vms (thanks Remi)

2012-01-26 Thread Walid nouh

On 26/01/2012 16:43, MoYo wrote:

Le 26/01/2012 16:06, Walid nouh a écrit :

Bonjour,

Remi a très justement faire remarquer que j'ai oublié d'ajouter les 
indexes sur la table glpi_computervirtualmachines en 0.80.

Est-ce que je peux ajouter les indexes pour la 0.83 ?



Salut,

Ca commence à faire vraiment tard pour modifier le schéma de DB...
Mais bon on est toujours en RC...
Donc vas-y.


Ca marche,
je commite ça.

Merci
Perso vu le peu de retour actuellement sur la 0.83, je serais même 
partant pour sortir une 0.83 en l'état.


++

Julien



Bonne journée à tous,
Walid.

 Original Message 
Subject: 	[glpi] walid | rev 17223 - [0.83] see #3289 simplier way to 
sychronize vms (thanks Remi)

Date:   Thu, 26 Jan 2012 15:57:22 +0100
From:   nore...@indepnet.net
To: undisclosed-recipients:;



walid has commited revision 17223 for the GLPI-PROJECT project.

Comments : [0.83] see #3289 simplier way to sychronize vms (thanks Remi)

Please take a moment to review their checkin : 
https://forge.indepnet.net/repositories/revision/glpi/17223



You have received this notification because you have either 
subscribed to it, or are involved in it.
To change your notification preferences, please click here: 
https://forge.indepnet.net/my/account



___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev




___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev


___
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev