Use root when listing installed packages

This fixes the access error when using RHSM:

[ERROR] dnf:547:MainThread @logutil.py:194 - [Errno 13] Permission
denied: '/var/log/rhsm/rhsm.log'

Change-Id: Ia2e4c866de8440ac8ed25fd5efdbaef23280ef85
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2020-08-18 17:24:24 +02:00 committed by wes hayutin
parent 1272382311
commit a7044e0ee3
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ for cont in $(${engine} ps | awk {'print $NF'} | grep -v NAMES); do
fi
${engine} exec $cont vmstat -s
${engine} exec $cont ps axfo %mem,size,rss,vsz,pid,args
${engine} exec $cont bash -c "\$(command -v dnf || command -v yum) list installed";
${engine} exec -u root $cont bash -c "\$(command -v dnf || command -v yum) list installed";
) &>> $INFO_DIR/${engine}_info.log;
container_cp $cont /var/lib/kolla/config_files/config.json $INFO_DIR/config.json;