Tâche #35855
Scénario #35868: Corrections client Zéphir à rétro-porter en 2.7
Remontée des fichiers_zephir type "container" (rétro-portage 2.7)
100%
Description
Bonjour,
En version 2.7, les fichiers_zephir de type « container » ne remontent pas correctement :
Il s'avère que le problème vient des fichiers configID.md5 qui ne contient pas les md5 des fichiers dans les containers.
La correction suivante (format diff) du fichier zephir/monitor/agentmanager/zephirservice.py règle le problème :
24a25
> from creole.client import CreoleClient
44a46,62
> creole_client = None
>
> def container_aware_path(path):
> global creole_client
> path_elements = path.split('::')
> path = Path(path_elements[0])
> name = path.name
> if len(path_elements) > 1 and path_elements[1]:
> container = path_elements[1]
> if not creole_client:
> creole_client = CreoleClient()
> container_path = creole_client.get_creole('container_path_{}'.format(container), None)
> if container_path:
> path = Path(container_path).joinpath(path)
> name = name + "::{}".format(container)
> return path, name
>
385c403
< fichier_serveur = Path(l.strip())
---
> fichier_serveur, name = container_aware_path(l.strip())
388c406
< data.append("{} {}\n".format(md5res, Path('fichiers_zephir').joinpath(fichier_serveur.name)))
---
> data.append("{} {}\n".format(md5res, Path('fichiers_zephir').joinpath(name)))
396c414
< Path('fichiers_zephir').joinpath(fichier_serveur.name, sub_fichier_serveur)))
---
> Path('fichiers_zephir').joinpath(name, sub_fichier_serveur)))
405c423
< fichier_serveur = Path(l.strip())
---
> fichier_serveur, name = container_aware_path(l.strip())
408c426
< data.append("{} {}\n".format(md5res, Path('fichiers_zephir').joinpath('variante', fichier_serveur.name)))
---
> data.append("{} {}\n".format(md5res, Path('fichiers_zephir').joinpath('variante', name)))
Serait-il possible s'il vous plait d'intéger cette modification dans une future version du paquet 2.7 ?
D'avance merci, bien cordialement,
Tom.
Demandes liées
Révisions associées
Rechercher les fichiers en conteneur au bon endroit.
Ref #35855
Historique
#1 Mis à jour par Joël Cuissinat il y a environ un mois
- Lié à Tâche #35129: Les fichiers envoyés dans un conteneur ne sont pas détectés ajouté
#2 Mis à jour par Joël Cuissinat il y a environ un mois
- Sujet changé de Remontée des fichiers_zephir type "container" à Remontée des fichiers_zephir type "container" (rétro-portage 2.7)
#3 Mis à jour par Tom Ricci il y a environ un mois
Bonjour Joël,
Presque oui, j'ai cependant dû adapter un peu le code de la 2.8, vu le passage python2 -> python3 (les f-strings n'existaient pas).
Bonne fin de journée,
Tom.
#4 Mis à jour par Joël Cuissinat il y a environ un mois
- Lié à Scénario #35309: Les fichiers complémentaires Zéphir sont vus comme non envoyé sur 2.7 ajouté
#5 Mis à jour par Joël Cuissinat il y a environ un mois
- Tâche parente mis à #35868
#6 Mis à jour par Benjamin Bohard il y a 28 jours
- Statut changé de Nouveau à À valider
#7 Mis à jour par Benjamin Bohard il y a 28 jours
- Assigné à mis à Benjamin Bohard
#8 Mis à jour par Ludwig Seys il y a 3 jours
- Statut changé de À valider à Résolu
- % réalisé changé de 0 à 100
#9 Mis à jour par Joël Cuissinat il y a 2 jours
Commit diffusé dans toutes les versions ≥ 2.7.2.
zephir-client$ git branch -r --contains 92b81c01 origin/2.7.2/master origin/2.8.0/master origin/2.8.1/master origin/2.9.0/master origin/HEAD -> origin/master origin/dist/eole/2.10.0/master origin/dist/eole/2.7.2/master origin/dist/eole/2.8.0/master origin/dist/eole/2.8.1/master origin/dist/eole/2.9.0/master origin/master