Skip to content

Fix bug #406: Get api_endpoints directly from the controller#407

Merged
jujubot merged 1 commit intojuju:masterfrom
davigar15:fix406
Apr 29, 2020
Merged

Fix bug #406: Get api_endpoints directly from the controller#407
jujubot merged 1 commit intojuju:masterfrom
davigar15:fix406

Conversation

@davigar15
Copy link
Copy Markdown

This should fix the bug #406.

I also added a new command for getting ControllerAPIInformation.

Comment thread juju/controller.py Outdated
log.debug('Getting information')
cloud_facade = client.CrossControllerFacade.from_connection(self.connection())
info = await cloud_facade.ControllerInfo()
return info
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just return the await here.

Also can we get a test around the info?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

Although I'm getting this error when testing it in OSM:

Exception: No facade CrossController in facades {'Action': 2, 'ActionPruner': 1, 'Agent': 2, 'AgentTools': 1, 'AllWatcher': 1, 'Annotations': 2, 'Application': 8, 'ApplicationScaler': 1, 'Backups': 2, 'Block': 2, 'Bundle': 3, 'CAASAgent': 1, 'CAASFirewaller': 1, 'CAASOperator': 1, 'CAASOperatorProvisioner': 1, 'CAASOperatorUpgrader': 1, 'CAASUnitProvisioner': 1, 'CharmRevisionUpdater': 2, 'Charms': 2, 'Cleaner': 2, 'Client': 2, 'CredentialManager': 1, 'CredentialValidator': 1, 'CrossModelRelations': 1, 'Deployer': 1, 'DiskManager': 2, 'EntityWatcher': 2, 'ExternalControllerUpdater': 1, 'FanConfigurer': 1, 'FilesystemAttachmentsWatcher': 2, 'FirewallRules': 1, 'Firewaller': 5, 'HighAvailability': 2, 'HostKeyReporter': 1, 'ImageManager': 2, 'ImageMetadata': 3, 'InstanceMutater': 2, 'InstancePoller': 3, 'KeyManager': 1, 'KeyUpdater': 1, 'LeadershipService': 2, 'LifeFlag': 1, 'LogForwarding': 1, 'Logger': 1, 'MachineActions': 1, 'MachineManager': 4, 'MachineUndertaker': 1, 'Machiner': 1, 'MeterStatus': 1, 'MetricsAdder': 2, 'MetricsDebug': 2, 'MetricsManager': 1, 'MigrationFlag': 1, 'MigrationMaster': 1, 'MigrationMinion': 1, 'MigrationStatusWatcher': 1, 'ModelConfig': 2, 'ModelGeneration': 2, 'ModelUpgrader': 1, 'NotifyWatcher': 1, 'OfferStatusWatcher': 1, 'Payloads': 1, 'PayloadsHookContext': 1, 'Pinger': 1, 'Provisioner': 6, 'ProxyUpdater': 2, 'Reboot': 2, 'RelationStatusWatcher': 1, 'RelationUnitsWatcher': 1, 'RemoteRelationWatcher': 1, 'RemoteRelations': 1, 'Resources': 1, 'ResourcesHookContext': 1, 'Resumer': 2, 'RetryStrategy': 1, 'SSHClient': 2, 'Singular': 2, 'Spaces': 3, 'StatusHistory': 2, 'Storage': 4, 'StorageProvisioner': 4, 'StringsWatcher': 1, 'Subnets': 2, 'Undertaker': 1, 'UnitAssigner': 1, 'Uniter': 8, 'UpgradeSeries': 1, 'UpgradeSteps': 1, 'Upgrader': 1, 'VolumeAttachmentPlansWatcher': 1, 'VolumeAttachmentsWatcher': 2}
2020-04-29T08:19:04 ERROR lcm.ns n2vc_juju_conn.py:251 Error creating machine on juju: Cannot get model 044736b4-ea83-4767-91af-db5cdc9065bf. Exception: No facade CrossController in facades {'Action': 2, 'ActionPruner': 1, 'Agent': 2, 'AgentTools': 1, 'AllWatcher': 1, 'Annotations': 2, 'Application': 8, 'ApplicationScaler': 1, 'Backups': 2, 'Block': 2, 'Bundle': 3, 'CAASAgent': 1, 'CAASFirewaller': 1, 'CAASOperator': 1, 'CAASOperatorProvisioner': 1, 'CAASOperatorUpgrader': 1, 'CAASUnitProvisioner': 1, 'CharmRevisionUpdater': 2, 'Charms': 2, 'Cleaner': 2, 'Client': 2, 'CredentialManager': 1, 'CredentialValidator': 1, 'CrossModelRelations': 1, 'Deployer': 1, 'DiskManager': 2, 'EntityWatcher': 2, 'ExternalControllerUpdater': 1, 'FanConfigurer': 1, 'FilesystemAttachmentsWatcher': 2, 'FirewallRules': 1, 'Firewaller': 5, 'HighAvailability': 2, 'HostKeyReporter': 1, 'ImageManager': 2, 'ImageMetadata': 3, 'InstanceMutater': 2, 'InstancePoller': 3, 'KeyManager': 1, 'KeyUpdater': 1, 'LeadershipService': 2, 'LifeFlag': 1, 'LogForwarding': 1, 'Logger': 1, 'MachineActions': 1, 'MachineManager': 4, 'MachineUndertaker': 1, 'Machiner': 1, 'MeterStatus': 1, 'MetricsAdder': 2, 'MetricsDebug': 2, 'MetricsManager': 1, 'MigrationFlag': 1, 'MigrationMaster': 1, 'MigrationMinion': 1, 'MigrationStatusWatcher': 1, 'ModelConfig': 2, 'ModelGeneration': 2, 'ModelUpgrader': 1, 'NotifyWatcher': 1, 'OfferStatusWatcher': 1, 'Payloads': 1, 'PayloadsHookContext': 1, 'Pinger': 1, 'Provisioner': 6, 'ProxyUpdater': 2, 'Reboot': 2, 'RelationStatusWatcher': 1, 'RelationUnitsWatcher': 1, 'RemoteRelationWatcher': 1, 'RemoteRelations': 1, 'Resources': 1, 'ResourcesHookContext': 1, 'Resumer': 2, 'RetryStrategy': 1, 'SSHClient': 2, 'Singular': 2, 'Spaces': 3, 'StatusHistory': 2, 'Storage': 4, 'StorageProvisioner': 4, 'StringsWatcher': 1, 'Subnets': 2, 'Undertaker': 1, 'UnitAssigner': 1, 'Uniter': 8, 'UpgradeSeries': 1, 'UpgradeSteps': 1, 'Upgrader': 1, 'VolumeAttachmentPlansWatcher': 1, 'VolumeAttachmentsWatcher': 2}
2020-04-29T08:19:04 ERROR lcm.ns ns.py:3000 Task ns=044736b4-ea83-4767-91af-db5cdc9065bf instantiate=3b6650ca-5874-4643-92fe-f84ce1fc7375 Deploying VCA 1.: create execution environment Error creating machine on juju: Cannot get model 044736b4-ea83-4767-91af-db5cdc9065bf. Exception: No facade CrossController in facades {'Action': 2, 'ActionPruner': 1, 'Agent': 2, 'AgentTools': 1, 'AllWatcher': 1, 'Annotations': 2, 'Application': 8, 'ApplicationScaler': 1, 'Backups': 2, 'Block': 2, 'Bundle': 3, 'CAASAgent': 1, 'CAASFirewaller': 1, 'CAASOperator': 1, 'CAASOperatorProvisioner': 1, 'CAASOperatorUpgrader': 1, 'CAASUnitProvisioner': 1, 'CharmRevisionUpdater': 2, 'Charms': 2, 'Cleaner': 2, 'Client': 2, 'CredentialManager': 1, 'CredentialValidator': 1, 'CrossModelRelations': 1, 'Deployer': 1, 'DiskManager': 2, 'EntityWatcher': 2, 'ExternalControllerUpdater': 1, 'FanConfigurer': 1, 'FilesystemAttachmentsWatcher': 2, 'FirewallRules': 1, 'Firewaller': 5, 'HighAvailability': 2, 'HostKeyReporter': 1, 'ImageManager': 2, 'ImageMetadata': 3, 'InstanceMutater': 2, 'InstancePoller': 3, 'KeyManager': 1, 'KeyUpdater': 1, 'LeadershipService': 2, 'LifeFlag': 1, 'LogForwarding': 1, 'Logger': 1, 'MachineActions': 1, 'MachineManager': 4, 'MachineUndertaker': 1, 'Machiner': 1, 'MeterStatus': 1, 'MetricsAdder': 2, 'MetricsDebug': 2, 'MetricsManager': 1, 'MigrationFlag': 1, 'MigrationMaster': 1, 'MigrationMinion': 1, 'MigrationStatusWatcher': 1, 'ModelConfig': 2, 'ModelGeneration': 2, 'ModelUpgrader': 1, 'NotifyWatcher': 1, 'OfferStatusWatcher': 1, 'Payloads': 1, 'PayloadsHookContext': 1, 'Pinger': 1, 'Provisioner': 6, 'ProxyUpdater': 2, 'Reboot': 2, 'RelationStatusWatcher': 1, 'RelationUnitsWatcher': 1, 'RemoteRelationWatcher': 1, 'RemoteRelations': 1, 'Resources': 1, 'ResourcesHookContext': 1, 'Resumer': 2, 'RetryStrategy': 1, 'SSHClient': 2, 'Singular': 2, 'Spaces': 3, 'StatusHistory': 2, 'Storage': 4, 'StorageProvisioner': 4, 'StringsWatcher': 1, 'Subnets': 2, 'Undertaker': 1, 'UnitAssigner': 1, 'Uniter': 8, 'UpgradeSeries': 1, 'UpgradeSteps': 1, 'Upgrader': 1, 'VolumeAttachmentPlansWatcher': 1, 'VolumeAttachmentsWatcher': 2}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonRichardson Any ideas?

@jujubot
Copy link
Copy Markdown
Contributor

jujubot commented Apr 29, 2020

Can one of the admins verify this patch?

1 similar comment
@jujubot
Copy link
Copy Markdown
Contributor

jujubot commented Apr 29, 2020

Can one of the admins verify this patch?

@SimonRichardson SimonRichardson self-requested a review April 29, 2020 10:41
Comment thread juju/controller.py Outdated
Comment thread test.py Outdated
@SimonRichardson
Copy link
Copy Markdown
Member

!!build!!

1 similar comment
@SimonRichardson
Copy link
Copy Markdown
Member

!!build!!

@SimonRichardson
Copy link
Copy Markdown
Member

!!build!!

@SimonRichardson
Copy link
Copy Markdown
Member

$$merge$$

@jujubot jujubot merged commit b5e1157 into juju:master Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants