Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions bin/oci-attached-volumes

This file was deleted.

2 changes: 1 addition & 1 deletion bin/oci-network-config
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ then
cmd_line="$cmd_line --ip-address=${PRIVATE_IP}"
fi
# else
# echo "${COMMAND} handled elsewhere"
# echo "_GT_ ${COMMAND} handled elsewhere"
fi

if [ ${EXCLUDED_ITEMS[${COMMAND}]+_} ] && [ -n "${EXCLUDED_ITEMS[${COMMAND}]}" ]
Expand Down
39 changes: 34 additions & 5 deletions buildrpm/oci-utils.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Name: oci-utils
Version: 0.14.0
Release: 3%{?dist}
Release: 8%{?dist}
Url: http://cloud.oracle.com/iaas
Summary: Oracle Cloud Infrastructure utilities
License: UPL
Group: Development/Tools

Source: %{name}-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Expand Down Expand Up @@ -135,6 +136,12 @@ Utilities migrate unit tests
%{__cp} -r setup.py %{buildroot}/opt/oci-utils
%{__cp} -r requirements.txt %{buildroot}/opt/oci-utils
%{__cp} -r README.md %{buildroot}/opt/oci-utils
# oci-image-expand files
%{__mkdir_p} %{buildroot}%{_sysconfdir}/rsyslog.d
%{__mkdir_p} %{buildroot}%{_libexecdir}
%{__cp} -r etc/rsyslog.d/12-oci-utils.conf %{buildroot}%{_sysconfdir}/rsyslog.d/.
%{__cp} -r libexec/oci-image-expand %{buildroot}%{_libexecdir}/.
%{__cp} -r usr/share/man/man8/oci-image-expand.8 %{buildroot}%{_datadir}/man/man8/.

%clean
rm -rf %{buildroot}
Expand Down Expand Up @@ -164,6 +171,10 @@ rm -rf %{buildroot}
%exclude %{_datadir}/man/man1/oci-kvm.1.gz
%dir %{_localstatedir}/lib/oci-utils
%doc LICENSE.txt PKG-INFO
# oci-image-expand files
%attr(644,root,root) %{_sysconfdir}/rsyslog.d/12-oci-utils.conf
%attr(755,root,root) %{_libexecdir}/oci-image-expand
%attr(644,root,root) %{_datadir}/man/man8/oci-image-expand.8.gz

%files kvm
%{_bindir}/oci-kvm
Expand All @@ -179,6 +190,10 @@ rm -rf %{buildroot}
%exclude /opt/oci-utils/tests/test_mig*
/opt/oci-utils

%post
# Need to restart the rsyslogd service when the RPM is installed or upgraded
/bin/systemctl restart rsyslog.service

%post kvm
%systemd_post oci-kvm-config.service

Expand Down Expand Up @@ -206,10 +221,24 @@ rm -rf %{buildroot}
/opt/oci-utils/tests/__init__*

%changelog
* Thu Sep 22 2022 Guido Tijskens <[email protected]> -- 0.14.0-3
- LINUX-11440/LINUX-12246 iscsi does not fall back to scanning if authentication succeeds but get instance data fails
- added oci-attached-volumes, collects data on volumes, via OCI if priviliges in place, via scan otherwise.
- LINUX-12907 sudo oci-network-config --show missing spaces between values
* Mon Oct 14 2024 Jesse Gordon <[email protected]> -- 0.14.0-8
- oci-network-config: fix for too long VNIC names [Orabug: 36991547]

* Tue Jul 30 2024 Jesse Gordon <[email protected]> -- 0.14.0-7
- oci-image-expand: new utility to restore functionality, with conf file for logging and a man page [Orabug: 36223392]

* Thu Jul 11 2024 Oussama Jamal <[email protected]> -- 0.14.0-6
- oci-kvm: add patch information for the iommu_check fix [Orabug: 36380825]

* Thu Jun 20 2024 Oussama Jamal <[email protected]> -- 0.14.0-5
- oci-kvm: fix the iommu_check failure [Orabug: 36380825]

* Tue Sep 5 2023 Kaylin Devchand <[email protected]> -- 0.14.0-4
- oci-image-cleanup: preserve oci.sh [Orabug: 35766360]
- oci-image-cleanup: remove backup log directories [Orabug: 35766353]

* Mon Aug 7 2023 Oussama Jamal <[email protected]> -- 0.14.0-3
- Make ocid vendor preset disabled [Orabug: 35683717]

* Mon Sep 5 2022 Guido Tijskens <[email protected]> -- 0.14.0-2
- LINUX-12761/OLUEK-6199 ocid leaves lots of connections in CLOSE_WAIT state
Expand Down
2 changes: 1 addition & 1 deletion data/91-oci-utils.preset
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# https://fedoraproject.org/wiki/Starting_services_by_default

# ocid
enable ocid.service
disable ocid.service
16 changes: 8 additions & 8 deletions data/oci-migrate-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ ol_os_oci_region_bash :
- '#!/bin/bash'
- unset http_proxy
- unset https_proxy
- CURL=$(command -v curl)
- JQ=$(command -v jq)
- CUT=$(command -v cut)
- CURL=$(which curl)
- JQ=$(which jq)
- CUT=$(which cut)
- METADATAURL="http://169.254.169.254"
- OCIREGION=$(${CURL} -sfm 5 ${METADATAURL}/opc/v1/instance/ | ${JQ} -r '.region' | ${CUT} -d '-' -f 2)
- echo '-'$OCIREGION > /etc/yum/vars/ociregion
Expand All @@ -313,9 +313,9 @@ ubuntu_os_snapd_bash:
- '#!/bin/bash'
- SNAPD='snapd'
- snaplist=_XXXX_
- SNAP=$(command -v snap)
- SYSCTL=$(command -v systemctl)
- LOGGER=$(command -v logger)
- SNAP=$(which snap)
- SYSCTL=$(which systemctl)
- LOGGER=$(which logger)
- ${SYSCTL} enable ${SNAPD}
- ${SYSCTL} start ${SNAPD}
- snapdstatus=$(${SYSCTL} status ${SNAPD})
Expand All @@ -338,8 +338,8 @@ reinitialise_cloud_init_script : /usr/local/bin/reinitialise_cloud_init.sh
reinitialise_cloud_init:
- '#!/bin/bash'
- CLOUDINIT='cloud-init'
- RM=$(command -v rm)
- SYSTEMCTL=$(command -v systemctl)
- RM=$(which rm)
- SYSTEMCTL=$(which systemctl)
- VARLIBCLOUD='/var/lib/cloud/'
- VARLOGCLOUD='/var/log/cloud'
- ${RM} -rf "${VARLIBCLOUD}*"
Expand Down
2 changes: 2 additions & 0 deletions etc/rsyslog.d/12-oci-utils.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:syslogtag, startswith, "oci-image-expand" /var/log/oci-image-expand.log
& stop
4 changes: 3 additions & 1 deletion lib/oci_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def is_root_user():
-------
bool: True if root, False otherwise.
"""
return bool(os.getuid() == 0)
if os.geteuid() != 0:
return False
return True


def get_os_release_data():
Expand Down
3 changes: 3 additions & 0 deletions lib/oci_utils/impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
SYSTEMCTL_CMD = '/bin/systemctl'
LSBLK_CMD = '/bin/lsblk'

IF_NAME_PREFIX = 'vlan'
MACVLAN_IF_NAME_PREFIX = 'macvlan'


def print_choices(header, choices, sep="\n "):
"""
Expand Down
Loading