From 96c0217d6077bb264a215804a0cddd2ca8923a18 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 5 Jan 2017 08:13:53 -0800 Subject: [PATCH 1/3] Require dcoscli `0.4.15` --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c925131..dc8e73e 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ zip_safe=False, install_requires=[ 'click', - 'dcoscli==0.4.14', + 'dcoscli==0.4.15', 'paramiko', 'pytest', 'pytest-timeout', From 70fb0756f0de89c6568cdef48c924bbbe079ab11 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 5 Jan 2017 09:20:45 -0800 Subject: [PATCH 2/3] `cosmospackage` -> `packagemanager` name change --- shakedown/dcos/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shakedown/dcos/package.py b/shakedown/dcos/package.py index 89051fb..8800ea7 100644 --- a/shakedown/dcos/package.py +++ b/shakedown/dcos/package.py @@ -1,7 +1,7 @@ import json import time -from dcos import (cosmospackage, subcommand) +from dcos import (packagemanager, subcommand) from dcoscli.package.main import get_cosmos_url import shakedown @@ -29,10 +29,10 @@ def _get_cosmos(): """ Get an instance of Cosmos with the correct URL. :return: Cosmos instance - :rtype: cosmospackage.Cosmos + :rtype: packagemanager.Cosmos """ - return cosmospackage.Cosmos(get_cosmos_url()) + return packagemanager.Cosmos(get_cosmos_url()) def install_package( From c4809f37c379122a12f5a27c0ec9a4e246cda141 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 5 Jan 2017 09:25:59 -0800 Subject: [PATCH 3/3] Additional updates for Cosmos changes --- shakedown/dcos/package.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/shakedown/dcos/package.py b/shakedown/dcos/package.py index 8800ea7..e22cd78 100644 --- a/shakedown/dcos/package.py +++ b/shakedown/dcos/package.py @@ -1,8 +1,7 @@ import json import time -from dcos import (packagemanager, subcommand) -from dcoscli.package.main import get_cosmos_url +from dcos import (cosmos, packagemanager, subcommand) import shakedown @@ -25,14 +24,14 @@ def _get_options(options_file=None): return options -def _get_cosmos(): +def _get_package_manager(): """ Get an instance of Cosmos with the correct URL. :return: Cosmos instance - :rtype: packagemanager.Cosmos + :rtype: packagemanager.PackageManager """ - return packagemanager.Cosmos(get_cosmos_url()) + return packagemanager.PackageManager(cosmos.get_cosmos_url()) def install_package( @@ -72,8 +71,8 @@ def install_package( else: options = {} - cosmos = _get_cosmos() - pkg = cosmos.get_package_version(package_name, package_version) + package_manager = _get_package_manager() + pkg = package_manager.get_package_version(package_name, package_version) if service_name is None: labels = pkg.marathon_json(options).get('labels') if 'DCOS_SERVICE_NAME' in labels: @@ -95,7 +94,7 @@ def install_package( if pre_install_notes: print(pre_install_notes) - cosmos.install_app(pkg, options, service_name) + package_manager.install_app(pkg, options, service_name) # Print post-install notes to console log post_install_notes = pkg.package_json().get('postInstallNotes') @@ -154,8 +153,8 @@ def package_installed(package_name, service_name=None): :rtype: bool """ - cosmos = _get_cosmos() - return len(cosmos.installed_apps(package_name, service_name)) > 0 + package_manager = _get_package_manager() + return len(package_manager.installed_apps(package_name, service_name)) > 0 def uninstall_package( @@ -182,8 +181,8 @@ def uninstall_package( :rtype: bool """ - cosmos = _get_cosmos() - pkg = cosmos.get_package_version(package_name, None) + package_manager = _get_package_manager() + pkg = package_manager.get_package_version(package_name, None) if service_name is None: labels = pkg.marathon_json({}).get('labels') if 'DCOS_SERVICE_NAME' in labels: @@ -200,7 +199,7 @@ def uninstall_package( shakedown.cli.helpers.fchr('>>'), package_name, service_name) ) - cosmos.uninstall_app(package_name, all_instances, service_name) + package_manager.uninstall_app(package_name, all_instances, service_name) # Optionally wait for the service to unregister as a framework if wait_for_completion: @@ -243,8 +242,8 @@ def get_package_repos( """ Return a list of configured package repositories """ - cosmos = _get_cosmos() - return cosmos.get_repos() + package_manager = _get_package_manager() + return package_manager.get_repos() def add_package_repo( @@ -265,8 +264,8 @@ def add_package_repo( :rtype: bool """ - cosmos = _get_cosmos() - return cosmos.add_repo(repo_name, repo_url, index) + package_manager = _get_package_manager() + return package_manager.add_repo(repo_name, repo_url, index) def remove_package_repo( @@ -281,5 +280,5 @@ def remove_package_repo( :rtype: bool """ - cosmos = _get_cosmos() - return cosmos.remove_repo(repo_name) + package_manager = _get_package_manager() + return package_manager.remove_repo(repo_name)