Skip to content

Commit 015ef75

Browse files
Merge pull request #145 from guidotijskens/version0128
oci-utils 0.12.8-1
2 parents 9e8ad91 + f968c26 commit 015ef75

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
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.8
3-
Release: 0%{?dist}
3+
Release: 1%{?dist}
44
Url: http://cloud.oracle.com/iaas
55
Summary: Oracle Cloud Infrastructure utilities
66
License: UPL
@@ -36,6 +36,7 @@ Requires: python3-sdnotify
3636
%if 0%{?rhel} == 8
3737
Requires: network-scripts
3838
Requires: python3-netaddr
39+
Requires: python36-oci-sdk
3940
Requires: python3-daemon
4041
Requires: python3-sdnotify
4142
%endif
@@ -205,6 +206,9 @@ rm -rf %{buildroot}
205206
/opt/oci-utils/tests/__init__*
206207

207208
%changelog
209+
* Thu Apr 14 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.8-1
210+
- fixed oci-public-ip all flag: removed
211+
208212
* Wed Mar 30 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.7-3
209213
- spec file fixed for ol9 builds of oci-kvm and oci-migrate
210214
- tests for instance distribution and version

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def parse_args():
5757
help="display details information")
5858
parser.add_argument('-a', '--all',
5959
action='store_true',
60-
help='list all of the public IP addresses for the instance.')
60+
# help='list all of the public IP addresses for the instance.')
61+
help = argparse.SUPPRESS)
6162
parser.add_argument('-s', '--sourceip',
6263
action='store',
6364
default="0.0.0.0",
@@ -92,10 +93,10 @@ def _display_ip_list(ip_list, displayALL, outputMode, displayDetails):
9293
displayDetails : display detailed information ?
9394
"""
9495

96+
_sorted_list_of_pubips = sorted(ip_list, key=lambda ip: ip['primary'], reverse=True)
9597
if displayALL:
9698
_ip_list_to_display = ip_list
9799
else:
98-
# We assume that primary is the first one and we want to display only it
99100
_ip_list_to_display = ip_list[:1]
100101

101102
_collen = {'ipaddress': len('IP Address'),
@@ -136,7 +137,7 @@ def _display_ip_list(ip_list, displayALL, outputMode, displayDetails):
136137

137138
_printer = printerKlass(title=_title, columns=_columns)
138139
_printer.printHeader()
139-
_sorted_list_of_pubips = sorted(_ip_list_to_display, key=lambda ip: ip['primary'], reverse=True)
140+
# _sorted_list_of_pubips = sorted(_ip_list_to_display, key=lambda ip: ip['primary'], reverse=True)
140141
for _ip in _sorted_list_of_pubips:
141142
_printer.printRow(_ip)
142143
_printer.printFooter()
@@ -201,7 +202,7 @@ def main():
201202
'vnic_ocid': v.get_ocid()} for v in _instance.all_vnics() if v.get_public_ip()]
202203
stun_log.debug('%s ips retrieved from sdk information', len(_all_p_ips))
203204
if len(_all_p_ips) == 0:
204-
stun_log.info('No public ip addresses found from OCI, falling back to the stun servers.')
205+
# stun_log.info('No public ip addresses found from OCI, falling back to the stun servers.')
205206
_instance=None
206207
except Exception as e:
207208
stun_log.info('Instance is missing privileges to collect ip data from OCI, '
@@ -247,7 +248,8 @@ def main():
247248
for ip in _all_p_ips:
248249
print('%16s' % ip['ip'])
249250
else:
250-
_display_ip_list(_all_p_ips, args.all, args.output_mode, args.details)
251+
# _display_ip_list(_all_p_ips, args.all, args.output_mode, args.details)
252+
_display_ip_list(_all_p_ips, True, args.output_mode, args.details)
251253

252254
return 0
253255

man/man1/oci-public-ip.1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
.SH NAME
1010
oci-public-ip \- display the public IP address of the system
1111
.SH SYNOPSIS
12-
.B oci-public-ip [-h|--human-readable] [-j|--json] [-g|--get] [-a|--all] [-s
12+
.\" .B oci-public-ip [-h|--human-readable] [-j|--json] [-g|--get] [-a|--all] [-s
13+
.B oci-public-ip [-h|--human-readable] [-j|--json] [-g|--get] [-s
1314
.I SOURCEIP
1415
.B | --sourceip
1516
.I SOURCEIP
@@ -32,8 +33,8 @@ Print the public IP address(es) in JSON format, intended for scripting.
3233
.IP -g,\ --get
3334
Print the public IP address(es) (and nothing else) to the standard output.
3435
Intended for scripting.
35-
.IP -a,\ --all
36-
Print all of the public IP addresses to the standard output.
36+
.\" .IP -a,\ --all
37+
.\" Print all of the public IP addresses to the standard output.
3738
.IP "-s SOURCEIP, --sourceip SOURCEIP"
3839
Determine the public IP address that belongs to the
3940
.B SOURCEIP

0 commit comments

Comments
 (0)