Registry / devops / cloudshell-shell-core

cloudshell-shell-core

JSON →
library6.0.2pypypi✓ verified 85d ago

Core package for all CloudShell Shells, providing basic driver interfaces, metadata definitions, utilities, and helpers. Current version: 6.0.2. Released under Apache 2.0, maintained by QualiSystems. Regular releases on PyPI.

pip install cloudshell-shell-core
INSTALL
IMPORT
SIG · CLOUDSHELL-SHELL-C
C
cloudshell-shell-core
devopspythonv6.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ConnectivityContext
from cloudshell.shell.core.driver_context import ConnectivityContext
from cloudshell.shell.core.context import ConnectivityContext
Correct module is driver_context, not context
ResourceCommandContext
from cloudshell.shell.core.driver_context import ResourceCommandContext
from cloudshell.shell.core.context import ResourceCommandContext
Common mistake: context module renamed to driver_context in v5.1
OrchestrationSaveRestore
from cloudshell.shell.core.orchestration import OrchestrationSaveRestore
Shell
from cloudshell.shell.core.driver_context import Shell

Basic usage to initialize a session and get shell configuration.

from cloudshell.shell.core.driver_context import ResourceCommandContext, ConnectivityContext from cloudshell.shell.core.configuration import ShellConfiguration from cloudshell.shell.core.session import Session # Initialize a session (authentication usually via environment variables) session = Session(host=os.environ.get('CLOUDSHELL_SERVER', ''), token=os.environ.get('CLOUDSHELL_TOKEN', '')) # Get shell configuration config = ShellConfiguration(session=session, shell_name='MyShell') print(f'Shell version: {config.shell_version}')
Debug
Known issues
breakingOrchestrationSaveRestore init no longer accepts a logger parameter. Constructor signature changed in v6.0.0.
fix
Remove the logger argument from OrchestrationSaveRestore initialization. Use logging.getLogger() separately if needed.
affects: >=6.0.0
breakingLogging v2 changes: default log_category changed to "cloudshell", and log file prefix always uses resource name (not app name in sandbox).
fix
Update any code relying on log file naming or category strings. Use the new logging helper from cloudshell-logging.
affects: >=6.0.0
gotchaImport paths changed in v5.1: context classes moved from `cloudshell.shell.core.context` to `cloudshell.shell.core.driver_context`.
fix
Change imports to use `driver_context` module.
affects: >=5.1.0
deprecatedPython 2 support removed in v6.0.0.
fix
Upgrade Python to 3.7+.
affects: >=6.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'cloudshell.shell.core.context'
In v5.1, the context module was renamed to driver_context.
fix
Use `from cloudshell.shell.core.driver_context import ...` instead.
TypeError: __init__() got an unexpected keyword argument 'logger'
OrchestrationSaveRestore constructor removed the logger parameter in v6.0.0.
fix
Remove the logger argument from OrchestrationSaveRestore() call.
AttributeError: 'ResourceCommandContext' object has no attribute 'reservation'
Reservation context fields changed in newer versions; access via `reservation_context.reservation` or similar.
fix
Use the new context attributes: `context.reservation_context.reservation`.
ImportError: cannot import name 'ShellConfiguration' from 'cloudshell.shell.core'
ShellConfiguration may have been moved or removed; use config from cloudshell-core.
fix
Import from `cloudshell.core.configuration.ShellConfiguration` or check cloudshell-core package.
Upgrade
Version history
6.0.2latest on PyPI · released Oct 25, 2023
Audit
Dependencies
cloudshell-corerequiredProvides core connectivity and API functionality
Agent activity
2 hits · last 30 days
node
2
Resources
cloudshell-shell-core — pip install cloudshell-shell-core · libregistry