Project

General

Profile

Tâche #13661

Scénario #9005: Étude Nebula Marketplace proposant des images existantes sur One.

script de publication d'une image dans le market

Added by Scrum Master over 5 years ago. Updated over 5 years ago.

Status:
Fermé
Priority:
Normal
Start date:
10/12/2015
Due date:
% Done:

10%

Estimated time:
10.00 h
Spent time:
Remaining (hours):
0.0

Description

Ajout dans /etc/one/oned.conf ( attention si module Hapy ==> dans /usr/share/eole/creole/distrib/oned.conf )

VM_HOOK = [
    name    = "AppMarket_Vm",
    on      = "SHUTDOWN",
    command = "eole/appmarket_update.sh",
    arguments = "VM_HOOK $ID",
    remote  = "YES" 
]
IMAGE_HOOK = [
    name    = "AppMarket_Image",
    on      = "RUNNING",
    command = "eole/appmarket_update.sh",
    arguments = "IMAGE_HOOK $ID",
    remote  = "YES" 
]

Script /var/lib/one/remotes/hooks/eole/appmarket_update.sh

#!/bin/bash

typeHook=${1}
ID=${2}

function log()
{
    echo "$*" >>/var/log/one/appmarket_update.log
}

function xpath()
{
    echo "$template" | /var/lib/one/remotes/datastore/xpath.rb --stdin $*
}

function getProperty()
{
    echo "$template" | grep "$1" 
}

case "$typeHook" in
    VM_HOOK)
        template=$(onevm show $ID -x )
        USER_NAME=$(xpath UNAME)
        OWNER_USE_PERMISSION=$(xpath PERMISSIONS/OWNER_U)
        log "$typeHook $ID $USER_NAME $OWNER_USE_PERMISSION" 
        log "$template" 
        exit 0
        ;;

    IMAGE_HOOK)
        template=$(oneimg show $ID )
        USER_NAME=$(xpath UNAME)
        SOURCE=$(getProperty SOURCE)
        log "$typeHook $ID $USER_NAME $SOURCE" 
        log "$template" 
        exit 0
        ;;

    *)
        log "$typeHook inconnu !" 
        exit 1
        ;;
esac

History

#1 Updated by Scrum Master over 5 years ago

  • Status changed from Nouveau to En cours

#2 Updated by Scrum Master over 5 years ago

  • Assigned To set to Gilles Grandgérard

#3 Updated by Gilles Grandgérard over 5 years ago

  • % Done changed from 0 to 10
  • Estimated time set to 10.00 h
  • Remaining (hours) set to 10.0

#4 Updated by Gilles Grandgérard over 5 years ago

  • Description updated (diff)

#5 Updated by Gilles Grandgérard over 5 years ago

  • Description updated (diff)

#6 Updated by Klaas TJEBBES over 5 years ago

  • Description updated (diff)

#7 Updated by Gilles Grandgérard over 5 years ago

  • Description updated (diff)

#8 Updated by Scrum Master over 5 years ago

  • Status changed from En cours to Résolu

#9 Updated by Joël Cuissinat over 5 years ago

  • Description updated (diff)
  • Remaining (hours) changed from 10.0 to 0.0

#10 Updated by Scrum Master over 5 years ago

  • Status changed from Résolu to Fermé

Also available in: Atom PDF