Revision 38552c68

b/snf-image-helper/decode-properties.py
46 46
    for key, value in properties.items():
47 47
        os.environ['SNF_IMAGE_PROPERTY_' + key] = value
48 48

  
49
    output = StringIO(subprocess.check_output(['bash', '-c', 'set']))
49
    p = subprocess.Popen(['bash', '-c', 'set'], stdout=subprocess.PIPE)
50
    output = StringIO(p.communicate()[0]);
50 51
    for line in iter(output):
51 52
        if line.startswith('SNF_IMAGE_PROPERTY_'):
52
            outfh.write(line)
53
            outfh.write('export ' + line)
53 54

  
54 55
    infh.close()
55 56
    outfh.close()
b/snf-image-helper/snf-image-helper.in
62 62
if [ -n "$SNF_IMAGE_PROPERTIES" ]; then
63 63
    properties=$(mktemp --tmpdir properties.XXXXXX)
64 64
    add_cleanup rm "$properties"
65
    echo "SNF_IMAGE_PROPERTIES" |
66
        "@scriptsdir@/snf-decode-properties.py" > "$properties"
65
    echo "$SNF_IMAGE_PROPERTIES" |
66
        "@scriptsdir@/decode-properties.py" "$properties"
67 67
    source "$properties"
68 68
else
69 69
    log_error "SNF_IMAGE_PROPERTIES variable is missing"
b/snf-image-helper/tasks/10FixPartitionTable.in
37 37

  
38 38
new_pend=$(get_last_free_sector "$SNF_IMAGE_DEV")
39 39

  
40
#Extend the partition
40
if [ -z "$new_pend" ] ; then
41
    # Nothing to do
42
    exit 0
43
fi
44

  
45
# Extend the partition
41 46

  
42 47
$PARTED -s -m "$SNF_IMAGE_DEV" rm "$id"
43 48
$PARTED -s -m "$SNF_IMAGE_DEV" mkpart primary "$ptype" "$pstart" "$new_pend"
44 49

  
45
#inform the kernel about the changes
50
# Inform the kernel about the changes
46 51
partprobe "$SNF_IMAGE_DEV"
47 52

  
48 53
exit 0

Also available in: Unified diff