Skip to content

Commit

Permalink
Merge pull request #78 from oracle/release_2018-08-09
Browse files Browse the repository at this point in the history
Releasing version 2.4.30
  • Loading branch information
paul-hummel-oracle authored Aug 9, 2018
2 parents b5d1f5e + c466a6d commit 500e10e
Show file tree
Hide file tree
Showing 63 changed files with 987 additions and 301 deletions.
41 changes: 30 additions & 11 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@ All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`__.

2.4.30 - 2018-08-09
---------------------
Added
~~~~~~~~
* Support for instances in the Compute service by fault domains (--fault-domain option for ``oci compute instance launch``)
* The ability to use a FIPS compliant version of libcrypto on linux platforms.
* Support for short date and time format when providing a datetime parameter to the CLI.

* YYYY-MM-DD HH:mm, e.g. 2017-09-15 17:25. The timezone for this date will be taken as UTC. (Needs to be surrounded by single or double quotes)

Fixed
~~~~~~~~
* The minimum python version check in the Windows install script now works properly with the following scenario. Previously version 2.7.13 was not being detected as greater than 2.7.5.


Changed
~~~~~~~~
* Moved all example scripts to separate 'examples' directory under scripts

2.4.29 - 2018-07-26
---------------------
Added
~~~~~~~~
* Support for Resource Search service (``oci search``)

* An example on using the Resource Search Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/resource_search_example.sh>`__.
* An example on using the Resource Search Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/examples/resource_search_example.sh>`__.

* Ability to set the scheduled backup policy on Boot Volume creation in the Block Storage Service. (``oci bv boot-volume create --backup-policy-id``)

Expand Down Expand Up @@ -56,15 +75,15 @@ Fixed
~~~~~~~~
* Cluster create command in Oracle Container Engine Service is not working correctly in previous release v2.4.25. It has been fixed as part of this release. (``oci ce cluster create`` fixed)

* A sample test using the Oracle Container (Kubernetes) Engine Service feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/test_containerengine.py>`__
* A sample test using the Oracle Container (Kubernetes) Engine Service feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/examples/test_containerengine.py>`__

2.4.25 - 2018-06-14
---------------------
Added
~~~~~~~~
* Support for Oracle Container Engine Service (``oci ce``)

* A sample test using the Oracle Container (Kubernetes) Engine Service feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/test_containerengine.py>`__
* A sample test using the Oracle Container (Kubernetes) Engine Service feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/examples/test_containerengine.py>`__

NOTE: Release 2.4.25 should not be used if you are trying to use Oracle Container Engine Service.
A bug with `oci ce cluster create` was discovered shortly after releasing version 2.4.25 to PyPi, so there is no 2.4.25 release on Github.
Expand Down Expand Up @@ -120,7 +139,7 @@ Fixed
Added
~~~~~~~~
* Support for returning ``event-name`` in logs extracted from Audit Service. (``oci audit event list``)
* Support for multiple hostnames per listener in Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/create_load_balancer.sh>`__ (``oci lb hostname`` and ``oci lb listener create --hostname-names``)
* Support for multiple hostnames per listener in Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/examples/create_load_balancer.sh>`__ (``oci lb hostname`` and ``oci lb listener create --hostname-names``)
* Support for FastConnect service. New commands as mentioned below are added:

* ``oci network cross-connect-group``
Expand Down Expand Up @@ -157,7 +176,7 @@ Added
---------------------
Added
~~~~~~~~
* An example of how to scale existing VM instances using the CLI can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/scale_vm_example.sh>`__
* An example of how to scale existing VM instances using the CLI can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/examples/scale_vm_example.sh>`__
* A warning message informing use of ``--all`` flag to get all items during list operations.

Fixed
Expand Down Expand Up @@ -204,7 +223,7 @@ Added
~~~~~~~~~~
* Support for the Email Service. (``oci email``)

* A sample test using the email feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/test_email.py>`__
* A sample test using the email feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/examples/test_email.py>`__
* This release does not include support for managing SMTP credentials. Please use the web console or any OCI SDK to manage SMTP credentials.

* Support for the following features in the Core Services:
Expand All @@ -226,7 +245,7 @@ Fixed
Added
~~~~~~~~~~
* Support for the File Storage Service. (``oci fs``)
* Support for Path Route Sets in the Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/create_load_balancer.sh>`__ (``oci lb path-route-set``)
* Support for Path Route Sets in the Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/examples/create_load_balancer.sh>`__ (``oci lb path-route-set``)
* Tagging support for *Bucket* resources in the Object Storage Service

* Create a bucket with tags: ``oci os bucket create --defined-tags --freeform-tags``
Expand All @@ -243,7 +262,7 @@ Added
~~~~~~~~~~
* Support for Domain Name System Service (oci dns)

* An example on using the Domain Name System Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/dns_example.sh>`__.
* An example on using the Domain Name System Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/examples/dns_example.sh>`__.

* Support for Reserved Public IPs in Virtual Networking Service (oci network public-ip)
* Support for the following features in Block Storage Service
Expand All @@ -268,7 +287,7 @@ Added

* Tags and tag namespaces can be managed via the 'oci iam tag-namespace' and 'oci iam tag' commands
* Operations which support applying tags will have --defined-tags and --freeform-tags options. Check the help dump (https://github.com/oracle/oci-cli/blob/master/tests/output/inline_help_dump.txt) for resources which support tags. A general list of taggable resources can also be found in: https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Taggable
* An example of using tagging can be found at https://github.com/oracle/oci-cli/blob/master/scripts/tagging_example.sh
* An example of using tagging can be found at https://github.com/oracle/oci-cli/blob/master/scripts/examples/tagging_example.sh

* Support for bringing your own custom image for emulation mode virtual machines in Compute Service (--launch-mode parameter on create image)
* Support for returning unquoted strings when the result of a JMESPath --query is a single string value (using --raw-output option)
Expand All @@ -292,7 +311,7 @@ Added
~~~~~~~~~~
* Support for Load Balancing Service operations ('oci lb')

* An example of creating a load balancer can be found a https://github.com/oracle/oci-cli/blob/master/scripts/create_load_balancer.sh
* An example of creating a load balancer can be found a https://github.com/oracle/oci-cli/blob/master/scripts/examples/create_load_balancer.sh

* Support for user managed boot volumes: 'oci bv boot-volume', 'oci compute instance launch --source-details', 'oci compute instance terminate --preserve-boot-volume'
* Operations which create, update or delete resources with a lifecycle-state now support a --wait-for-state option which allows you to perform the action and then wait until the resource reaches a given state
Expand All @@ -311,7 +330,7 @@ Added
* Support for Local Peering Gateway operations ('oci network local-peering-gateway')
* Support for specifying a default for the --profile option in the oci_cli_rc file
* Support create database from backup (oci db database create-from-backup)
* Support for getting archived object restore status ('oci os object restore-status') more details in sample (https://github.com/oracle/oci-cli/scripts/restore_archived_object.sh)
* Support for getting archived object restore status ('oci os object restore-status') more details in sample (https://github.com/oracle/oci-cli/scripts/examples/restore_archived_object.sh)

Changed
~~~~~~~~~~
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
appdirs==1.4.3
arrow==0.10.0
asn1crypto==0.22.0
certifi
cffi==1.9.1
click==6.7
Expand All @@ -13,13 +12,13 @@ Jinja2==2.9.6
jmespath==0.9.3
ndg-httpsclient==0.4.2
mock==2.0.0
oci==2.0.0
oci==2.0.1
packaging==16.8
pluggy==0.4.0
py==1.4.33
pyasn1==0.2.3
pycparser==2.17
pyOpenSSL==17.4.0
pycparser==2.17
pyparsing==2.2.0
pytest==3.2.3
pytest-cov==2.5.1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 16 additions & 9 deletions scripts/install/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,34 @@ function LogOutput($Output) {
}

function VersionMeetsMinimumRequirements($Version, $MinVersion) {
$Version = $Version.split('.')
$MinVersion = $MinVersion.split('.')
$VersionArray = @($Version.split('.'))
$MinVersionArray = @($MinVersion.split('.'))

For ($i=0; $i -le $Version.Length; $i++) {
For ($i=0; $i -le $VersionArray.Length; $i++) {
# if we have reached the end of the MinVersion and we still have digits on the system version then the version is sufficient
if ($i -ge $MinVersion.Length) {
if ($i -ge $MinVersionArray.Length) {
return $true
}

$VersionSegment = 0
Try {
$VersionSegment = [int]$VersionArray[$i]
} Catch {}
$MinVersionSegment = 0
Try {
$MinVersionSegment = [int]$MinVersionArray[$i]
} Catch {}
# loop from most significant to least significant digits in version
# if Version digit is ever greater than MinVersion, then version is sufficient
# if Version digit is ever less than MinVersion, the version is not sufficient
# if Version segment is ever greater than MinVersion, then version is sufficient
# if Version segment is ever less than MinVersion, the version is not sufficient
# if they are equal, we will continue to check less significant digits
if ($Version[$i] -gt $MinVersion[$i]) {
if ($VersionSegment -gt $MinVersionSegment) {
return $true
}
elseif ($Version[$i] -lt $MinVersion[$i]) {
elseif ($VersionSegment -lt $MinVersionSegment) {
return $false
}
}

return $true
}

Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def open_relative(*path):
filename = os.path.join(here, *path)
return io.open(filename, mode="r", encoding="utf-8")


with open_relative("src", "oci_cli", "version.py") as fd:
version = re.search(
r"^__version__\s*=\s*['\"]([^'\"]*)['\"]",
Expand All @@ -28,15 +27,13 @@ def open_relative(*path):
with open_relative("README.rst") as f:
readme = f.read()


requires = [
'oci==2.0.0',
'oci==2.0.1',
'arrow==0.10.0',
'certifi',
'click==6.7',
'configparser==3.5.0',
'cryptography==2.1.3',
'pyOpenSSL<=17.4.0',
'httpsig_cffi==15.0.0',
'jmespath==0.9.3',
'python-dateutil==2.7.3',
Expand All @@ -47,6 +44,13 @@ def open_relative(*path):
'idna>=2.5,<2.7'
]

fips_libcrypto_file = os.getenv("OCI_CLI_FIPS_LIBCRYPTO_FILE")
if fips_libcrypto_file:
from setuptools.command.easy_install import ScriptWriter
with open('src/oci_cli/oci_template.py', 'r') as template_file:
template = template_file.read()
ScriptWriter.template = template

setup(
name='oci-cli',
url='https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/cli.htm',
Expand Down
75 changes: 37 additions & 38 deletions src/oci_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
# coding: utf-8
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

import os
from . import fips

# This needs to be done prior to other imports otherwise things like hashlib
# may not get properly bound to the desired libcrypto.
fips_libcrypto_file = os.getenv("OCI_CLI_FIPS_LIBCRYPTO_FILE")
if fips_libcrypto_file:
fips.override_libcrypto(fips_libcrypto_file)
fips.patch_hashlib_md5()


# These imports are used by tests. The primary entry point for the CLI is cli.py.
from .cli_root import cli # noqa: F401
from .custom_types import cli_datetime # noqa: F401
from .custom_types import cli_from_json # noqa: F401
from .cli_root import cli # noqa: F401,E402
from .custom_types import cli_datetime # noqa: F401,E402
from .custom_types import cli_from_json # noqa: F401,E402

from .generated import audit_cli # noqa: F401
from .generated import blockstorage_cli # noqa: F401
from .generated import compute_cli # noqa: F401
from .generated import containerengine_cli # noqa: F401
from .generated import database_cli # noqa: F401
from .generated import dns_cli # noqa: F401
from .generated import email_cli # noqa: F401
from .generated import filestorage_cli # noqa: F401
from .generated import identity_cli # noqa: F401
from .generated import loadbalancer_cli # noqa: F401
from .generated import objectstorage_cli # noqa: F401
from .generated import resourcesearch_cli # noqa: F401
from .generated import virtualnetwork_cli # noqa: F401
from .generated import * # noqa: F401,F403,E402

from . import aliasing # noqa: F401
from . import audit_cli_extended # noqa: F401
from . import containerengine_cli_extended # noqa: F401
from . import core_cli_extended # noqa: F401
from . import database_cli_extended # noqa: F401
from . import dns_cli_extended # noqa: F401
from . import identity_cli_extended # noqa: F401
from . import objectstorage_cli_extended # noqa: F401
from . import resourcesearch_cli_extended # noqa: F401
from . import email_cli_extended # noqa: F401
from . import file_filters # noqa: F401
from . import final_command_processor # noqa: F401
from . import lb_cli_extended # noqa: F401
from . import cli_setup # noqa: F401
from . import cli_util # noqa: F401
from . import cli_exceptions # noqa: F401
from . import object_storage_transfer_manager # noqa: F401
from . import json_skeleton_utils # noqa: F401
from . import string_utils # noqa: F401
from . import help_text_producer # noqa: F401
from oci import config # noqa: F401
from .version import __version__ # noqa: F401
from . import aliasing # noqa: F401,E402
from . import audit_cli_extended # noqa: F401,E402
from . import containerengine_cli_extended # noqa: F401,E402
from . import core_cli_extended # noqa: F401,E402
from . import database_cli_extended # noqa: F401,E402
from . import dns_cli_extended # noqa: F401,E402
from . import identity_cli_extended # noqa: F401,E402
from . import objectstorage_cli_extended # noqa: F401,E402
from . import resourcesearch_cli_extended # noqa: F401,E402
from . import email_cli_extended # noqa: F401,E402
from . import file_filters # noqa: F401,E402
from . import final_command_processor # noqa: F401,E402
from . import lb_cli_extended # noqa: F401,E402
from . import cli_setup # noqa: F401,E402
from . import cli_util # noqa: F401,E402
from . import cli_exceptions # noqa: F401,E402
from . import object_storage_transfer_manager # noqa: F401,E402
from . import json_skeleton_utils # noqa: F401,E402
from . import string_utils # noqa: F401,E402
from . import help_text_producer # noqa: F401,E402
from oci import config # noqa: F401,E402
from .version import __version__ # noqa: F401,E402
2 changes: 1 addition & 1 deletion src/oci_cli/bin/OciTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ $ociCommandsToLongParams = @{
'compute instance detach-vnic' = 'compartment-id force from-json help max-wait-seconds vnic-id wait-for-state wait-interval-seconds'
'compute instance get' = 'from-json help instance-id'
'compute instance get-windows-initial-creds' = 'from-json help instance-id'
'compute instance launch' = 'assign-public-ip availability-domain boot-volume-size-in-gbs compartment-id defined-tags display-name extended-metadata freeform-tags from-json help hostname-label image-id ipxe-script-file max-wait-seconds metadata private-ip shape skip-source-dest-check source-boot-volume-id source-details ssh-authorized-keys-file subnet-id user-data-file vnic-display-name wait-for-state wait-interval-seconds'
'compute instance launch' = 'assign-public-ip availability-domain boot-volume-size-in-gbs compartment-id defined-tags display-name extended-metadata fault-domain freeform-tags from-json help hostname-label image-id ipxe-script-file max-wait-seconds metadata private-ip shape skip-source-dest-check source-boot-volume-id source-details ssh-authorized-keys-file subnet-id user-data-file vnic-display-name wait-for-state wait-interval-seconds'
'compute instance list' = 'all availability-domain compartment-id display-name from-json help lifecycle-state limit page page-size sort-by sort-order'
'compute instance list-vnics' = 'all from-json help instance-id limit page page-size'
'compute instance terminate' = 'force from-json help if-match instance-id max-wait-seconds preserve-boot-volume wait-for-state wait-interval-seconds'
Expand Down
14 changes: 1 addition & 13 deletions src/oci_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
from .cli_root import cli

# Add additional service cli imports here.
from .generated import audit_cli # noqa: F401
from .generated import blockstorage_cli # noqa: F401
from .generated import compute_cli # noqa: F401
from .generated import containerengine_cli # noqa: F401
from .generated import database_cli # noqa: F401
from .generated import dns_cli # noqa: F401
from .generated import email_cli # noqa: F401
from .generated import filestorage_cli # noqa: F401
from .generated import identity_cli # noqa: F401
from .generated import loadbalancer_cli # noqa: F401
from .generated import objectstorage_cli # noqa: F401
from .generated import resourcesearch_cli # noqa: F401
from .generated import virtualnetwork_cli # noqa: F401
from .generated import * # noqa: F401,F403

from . import audit_cli_extended # noqa: F401
from . import containerengine_cli_extended # noqa: F401
Expand Down
4 changes: 2 additions & 2 deletions src/oci_cli/cli_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import oci
from oci.audit import AuditClient
from oci.container_engine import ContainerEngineClient
from oci.core import BlockstorageClient
from oci.core import ComputeClient
from oci.core import VirtualNetworkClient
from oci.container_engine import ContainerEngineClient
from oci.database import DatabaseClient
from oci.dns import DnsClient
from oci.email import EmailClient
Expand All @@ -15,6 +14,7 @@
from oci.load_balancer import LoadBalancerClient
from oci.object_storage import ObjectStorageClient
from oci.resource_search import ResourceSearchClient
from oci.core import VirtualNetworkClient

CLIENT_MAP = {
"audit": AuditClient,
Expand Down
5 changes: 2 additions & 3 deletions src/oci_cli/cli_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from .cli_root import cli
from .cli_constants import CLI_RC_CANNED_QUERIES_SECTION_NAME, CLI_RC_COMMAND_ALIASES_SECTION_NAME, CLI_RC_PARAM_ALIASES_SECTION_NAME, CLI_RC_DEFAULT_LOCATION
from . import cli_util
from .util import pymd5

import base64
import hashlib

import os
import os.path
import stat
Expand Down Expand Up @@ -388,7 +387,7 @@ def public_key_to_fingerprint(public_key):
bytes = bytes.replace(header, b'').replace(footer, b'').replace(b'\n', b'')

key = base64.b64decode(bytes)
fp_plain = hashlib.md5(key).hexdigest()
fp_plain = pymd5.md5(key).hexdigest()
return ':'.join(a + b for a, b in zip(fp_plain[::2], fp_plain[1::2]))


Expand Down
Loading

0 comments on commit 500e10e

Please sign in to comment.