Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Hi,
When trying to verify a remote hostmaster, the Aegir Hosting Remote Import module now tries to get a "Successful" result from drush @hostmaster status (or even just any bootstrap info):
function verify_server_cmd() {
parent::verify_server_cmd();
// We should try to connect to the remote hostmaster server.
$result = $this->remote_execute('@hostmaster status');
if (
(!isset($result['object']['Drupal bootstrap']) || ($result['object']['Drupal bootstrap'] != 'Successful')) &&
(!isset($result['object']['bootstrap']) || ($result['object']['bootstrap'] != 'Successful'))
) {
return drush_set_error('REMOTE_SERVER_IS_NOT_MASTER', dt('The specified server is not an Aegir master server.'));
}
}
We got an error on this since our remote drush @hostmaster status commands returned a translated version of "Successful". Furthermore the command doesn't tell us if we have really a hostmaster installation (as a default Drupal site will return a "Successful" as well). So we need better validation for this. Patch is following.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | validation_for_remote-2849124-4.patch | 999 bytes | helmo |
| #2 | hosting_remote_import-verify_remote_hostmaster-2849124-2.patch | 972 bytes | ToRum |











Comments
Comment #2
ToRum CreditAttribution: ToRum commentedThis patch should allow a translation independent check.
Comment #3
helmo CreditAttribution: helmo at Initfour websolutions commentedThanks for the patch... multilingual fun :)
Not sure if someone ever tried but this would block us from importing from a devshop server (devmaster is their derivative install profile)
Comment #4
helmo CreditAttribution: helmo at Initfour websolutions commentedHere's an updated patch that would also work with devmaster.
Comment #5
Jon PughHard coding the name of the profile doesn't seem like a good idea... There's a function that checks if a site exists by testing bootstrap levels, let me look it up...
Comment #6
Jon PughHere's the issue I worked on to improve check for active site...
https://www.drupal.org/node/2764245
For another method, I check the exit code of a drush status call in the docker containers, however that's done in bash.
https://github.com/aegir-project/dockerfiles/blob/master/docker-entrypoi...
Not sure the best way forward, but checking for install profile name isn't it. There must be some other data in that array to check?
Comment #7
helmo CreditAttribution: helmo at Initfour websolutions commentedThe issue with both suggestions is that it only checks to see if the other end is an active Drupal site. The current situation also checks just that ... but depends on the install language. So testing on one of those is an improvement.
But what I think is intended by the check is to see if the other side is an OK Aegir frontend site. That array could be made configurable ... or we could test on the hosting module being enabled???
Comment #8
Jon PughAhh, I see what you mean now.
Yes, checking for the existence of the module is better than the profile, I think.
Thanks!
Comment #9
colan