Skip to content

Commit 715be9e

Browse files
Merge pull request #142 from guidotijskens/version01260
oci-utils 0.12.7-1
2 parents 29e94e8 + 317e3a8 commit 715be9e

14 files changed

+92
-46
lines changed

buildrpm/oci-utils.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: oci-utils
22
Version: 0.12.7
3-
Release: 0%{?dist}
3+
Release: 1%{?dist}
44
Url: http://cloud.oracle.com/iaas
55
Summary: Oracle Cloud Infrastructure utilities
66
License: UPL
@@ -176,6 +176,10 @@ rm -rf %{buildroot}
176176
/opt/oci-utils/tests/__init__*
177177

178178
%changelog
179+
* Wed Feb 16 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.7-1
180+
- LINUX-12109 Local iSCSI info not available" after running oci-iscsi-config sync
181+
- LINUX-12114 oci-utils help info contains ref to python main module iso the command
182+
179183
* Thu Feb 10 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.6-12
180184
- LINUX-12063 attach detach attach detach "is already detached" error
181185

lib/oci_utils/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def load_cache_11876(global_file, global_file_11876=None, user_file=None, max_ag
125125
else:
126126
# cache file does not yet exists
127127
_logger.debug('Cache file %s does not exist.', global_file)
128-
return None, None
128+
return 0, None
129129

130130

131131
def load_cache(global_file, user_file=None, max_age=None):

lib/oci_utils/impl/oci-growfs-main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def parse_args():
3333
-------
3434
The command line namespace
3535
"""
36-
parser = argparse.ArgumentParser(
37-
description='Utility for expanding the root¶¶ filesystem to its configured size.',
38-
add_help=False)
36+
parser = argparse.ArgumentParser(prog='oci-growfs',
37+
description='Utility for expanding the root¶¶ filesystem to its configured size.',
38+
add_help=False)
3939
group = parser.add_mutually_exclusive_group()
4040
group.add_argument('-y', '--yes',
4141
action='store_true',

lib/oci_utils/impl/oci-iscsi-config-main.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def get_args_parser():
132132
-------
133133
The commandline argparse namespace.
134134
"""
135-
parser = argparse.ArgumentParser(description='Utility for listing or configuring iSCSI devices on an OCI instance.')
135+
parser = argparse.ArgumentParser(prog='oci-iscsi-config',
136+
description='Utility for listing or configuring iSCSI devices on an OCI instance.')
136137
subparser = parser.add_subparsers(dest='command')
137138
#
138139
# sync
@@ -757,6 +758,8 @@ def display_attached_volumes(oci_sess, iscsiadm_session, disks, output_mode, det
757758
_logger.debug('Cannot get all volumes of this instance : %s', str(e))
758759

759760
if not iscsiadm_session and len(oci_vols) > 0:
761+
#
762+
# iscsiadm does not show volumes, oci_api.session does, attached volumes but not connected.
760763
print("Local iSCSI info not available.")
761764
print("List info from Cloud instead(No boot volume).")
762765
print("")
@@ -1869,6 +1872,20 @@ def get_max_volumes():
18691872
return max_vol
18701873

18711874

1875+
def get_iscsiadm_session():
1876+
"""
1877+
Find the attached block volumes with exception of the boot volume.
1878+
1879+
Returns
1880+
-------
1881+
dict: the attached block volumes and their data.
1882+
"""
1883+
1884+
all_volumes = iscsiadm.session()
1885+
iscsiadmsession = dict((iqn, all_volumes[iqn]) for iqn in all_volumes if 'boot:uefi' not in iqn)
1886+
return iscsiadmsession
1887+
1888+
18721889
def do_oci_vol_attach_ocid(oci_session, compatibility_mode, volume_iqn, use_chap_secrets):
18731890
"""
18741891
Collect data for attaching an iSCSI volume to this instance based on an ocid.
@@ -2196,6 +2213,9 @@ def main():
21962213
#
21972214
# collect iscsi volume information
21982215
system_disks = lsblk.list_blk_dev()
2216+
#
2217+
# we are not touching boot volume in iscsi config
2218+
# iscsiadm_session = get_iscsiadm_session()
21992219
iscsiadm_session = iscsiadm.session()
22002220
#
22012221
# the show option

lib/oci_utils/impl/oci-metadata-main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def parse_args():
106106
-------
107107
The argparse namespace.
108108
"""
109-
parser = argparse.ArgumentParser(description='Utility for displaying metadata for an instance running in '
109+
parser = argparse.ArgumentParser(prog='oci-metadata',
110+
description='Utility for displaying metadata for an instance running in '
110111
'the Oracle Cloud Infrastructure.',
111112
add_help=False)
112113
parser.add_argument('-h', '--human-readable', action='store_true',

lib/oci_utils/impl/oci-network-config-main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def get_arg_parser():
6262
-------
6363
The argparse namespace.
6464
"""
65-
parser = argparse.ArgumentParser(description='Utility for configuring network interfaces on an instance running '
65+
parser = argparse.ArgumentParser(prog='oci-network-config',
66+
description='Utility for configuring network interfaces on an instance running '
6667
'in the Oracle Cloud Infrastructure.')
6768
parser.add_argument('--quiet', '-q',
6869
action='store_true',

lib/oci_utils/impl/oci-network-inspector-main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ def parse_args():
2727
-------
2828
The argparse namespace.
2929
"""
30-
parser = argparse.ArgumentParser(description='Utility for exploring '
31-
'the network, its subnets '
32-
'and ips assigned for a '
33-
'given compartment or '
34-
'network.')
30+
parser = argparse.ArgumentParser(prog='oci-network-inspector',
31+
description='Utility for exploring the network, its subnets and ips assigned '
32+
'for a given compartment or network.')
3533
parser.add_argument('-C', '--compartment',
3634
metavar='OCID',
3735
action='store',

lib/oci_utils/impl/oci-notify-main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def parse_args():
7979
extra_descr += '%s\n' % (helpline.replace('MAX_MESSAGE_TITLE_LEN', str(MAX_MESSAGE_TITLE_LEN))
8080
.replace('CHUNK_SIZE', str(CHUNK_SIZE))
8181
.replace('MAX_MESSAGE_CHUNKS', str(MAX_MESSAGE_CHUNKS)))
82-
parser = argparse.ArgumentParser(description='%s' % extra_descr)
82+
parser = argparse.ArgumentParser(prog='oci-notify',
83+
description='%s' % extra_descr)
8384
sub_parser = parser.add_subparsers(dest='mode')
8485

8586
config_parser = sub_parser.add_parser('config', help='Configure the notification server.')

lib/oci_utils/impl/oci-public-ip-main.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ def parse_args():
3030
-------
3131
The command line namespace
3232
"""
33-
parser = argparse.ArgumentParser(
34-
description='Utility for displaying the public IP address of the '
35-
'current OCI instance.', add_help=False)
33+
parser = argparse.ArgumentParser(prog='oci-public-ip',
34+
description='Utility for displaying the public IP address of the '
35+
'current OCI instance.',
36+
add_help=False)
3637
group = parser.add_mutually_exclusive_group()
3738

3839
# deprecated option
@@ -155,7 +156,8 @@ def main():
155156
for server in STUN_SERVERS:
156157
print(server)
157158
return 0
158-
159+
#
160+
# Try to create a functional oci session
159161
_instance = None
160162
try:
161163
sess = oci_api.OCISession()
@@ -181,12 +183,12 @@ def main():
181183
_all_p_ips = [{'ip': v.get_public_ip(),
182184
'vnic_name': v.get_display_name(),
183185
'vnic_ocid': v.get_ocid()} for v in _instance.all_vnics() if v.get_public_ip()]
184-
stun_log.debug('%s ips retreived from sdk information', len(_all_p_ips))
186+
stun_log.debug('%s ips retrieved from sdk information', len(_all_p_ips))
185187
if len(_all_p_ips) == 0:
186-
stun_log.debug('No ips found, might be due to missing privilges, trying with stun servers')
188+
stun_log.info('No public ip(s) found from OCI, trying the stun servers.')
187189
_instance=None
188190
except Exception as e:
189-
stun_log.debug('Instance is missing privileges to collect ip data from OCI, falling back to stun servers.')
191+
stun_log.info('Instance is missing privileges to collect ip data from OCI, falling back to stun servers.')
190192
_instance = None
191193

192194
if _instance is None:

lib/oci_utils/impl/oci-volume-data-main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def command_line():
2323
-------
2424
The commandline argparse namespace.
2525
"""
26-
parser = argparse.ArgumentParser(description='Tool to display the oci properties of an iscsi volume.')
26+
parser = argparse.ArgumentParser(prog='oci-volume-data',
27+
description='Tool to display the oci properties of an iscsi volume.')
2728
parser.add_argument('-k', '--key',
2829
action='store',
2930
required=True,

0 commit comments

Comments
 (0)