Bug #467

Set language to english before running commands

Added by Javi Fontan about 9 years ago. Updated about 9 years ago.

Status:ClosedStart date:01/14/2011
Priority:NormalDue date:
Assignee:Javi Fontan% Done:

0%

Category:Drivers - Auth
Target version:Release 2.2
Resolution:fixed Pull request:
Affected Versions:

Description

Probes and commands rely on english output of commands so they fail when the OS language is set to other language.


Related issues

Duplicates Bug #462: breakage when using non-US locales Closed 01/11/2011

Associated revisions

Revision 98c51bcf
Added by Vlastimil Holer over 2 years ago

B #5222: Registering image with complex URL in PATH fails (#467)

  • B #5222: Secure image downloader: Escape XML references on ImageManager::stat_image

Revision 44077060
Added by Vlastimil Holer over 2 years ago

B #5222: Registering image with complex URL in PATH fails (#467)

  • B #5222: Secure image downloader: Escape XML references on ImageManager::stat_image

(cherry picked from commit 98c51bcf4f3b0313655d11945a24fe2327d9b414)

History

#1 Updated by Łukasz Oleś about 9 years ago

Instead of parsing programs output in bash script better idea is to use libvirt and xen api. For example /var/tmp/one/vmm/kvm/poll could be written in that way:

#!/bin/python
import sys

import libvirt

URI = 'qemu:///system'

states = {
        libvirt.VIR_DOMAIN_RUNNING : 'a',
        libvirt.VIR_DOMAIN_BLOCKED : 'a',
        libvirt.VIR_DOMAIN_SHUTDOWN : 'a',
        libvirt.VIR_DOMAIN_SHUTOFF : 'a',
        libvirt.VIR_DOMAIN_PAUSED : 'p',
        libvirt.VIR_DOMAIN_CRASHED : 'c',
}

conn = libvirt.openReadOnly(URI)
if conn == None:
    sys.exit(1)
try:
    domain = conn.lookupByID(int(sys.argv[1]))
    state, max_mem, mem, nr_cpus, time_cpu = domain.info()
    state = states.get(state, 'u')
    print 'STATE=%s MEMORY=%d' % (state, mem)
except:
    print 'STATE=d'


I'm using python bindings here, but of course ruby-bindings also exists.

#2 Updated by Javi Fontan about 9 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF