Hi guys, maybe we’ve got it
My current locale (IT):
LANG=it_IT.UTF-8
LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=
So every command running under Rockstor should have same issues by @Uwe_Ganswig, but we pass /system/osy.py run_command
“fake environment” settings:
def run_command(cmd, shell=False, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stdin=subprocess.PIPE, throw=True,
log=False, input=None):
try:
fake_env = dict(os.environ)
fake_env['LANG'] = 'en_US.UTF-8'
cmd = map(str, cmd)
p = subprocess.Popen(cmd, shell=shell, stdout=stdout, stderr=stderr,
stdin=stdin, env=fake_env)
and here my Rockstor run_command(s) in english (don’t care about error, Rockstor development environment misses rockstor package, that’s ok)
[root@rockstone ~]# tail /opt/build/var/log/rockstor.log
[19/Oct/2016 11:47:12] ERROR [storageadmin.util:33] Error running a command. cmd = ['/usr/bin/rpm', '-qi', 'rockstor']. rc = 1. stdout = ['package rockstor is not installed', '']. stderr = ['']
Traceback (most recent call last):
File "/opt/build/src/rockstor/storageadmin/util.py", line 31, in <module>
version, date = rpm_build_info('rockstor')
File "/opt/build/src/rockstor/system/pkg_mgmt.py", line 92, in rpm_build_info
o, e, rc = run_command([RPM, '-qi', pkg])
File "/opt/build/src/rockstor/system/osi.py", line 104, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = ['/usr/bin/rpm', '-qi', 'rockstor']. rc = 1. stdout = ['package rockstor is not installed', '']. stderr = ['']
[19/Oct/2016 11:47:17] DEBUG [storageadmin.views.command:152] Bootstrap operations completed