Open tassoskoutlas opened 7 years ago
Local version: 8.1.6 Remote version: 8.1.5
Try running with the --show-invoke global option. That will show what functions are being called.
@weitzman this is very weird. When I run sql-sync with --show-invoke
it goes straight into the Do you really want to continue? (y/n) question.
drush8 sql-sync @self @prod --show-invoke
You will destroy data in URL and replace with data from project.
Do you really want to continue? (y/n):
I've also tried with pm-updatecode which came back with a list like the following:
This codebase is assembled with Composer instead of Drush. Use `composer update` and `composer require` instead of `drush pm-updatecode` and `drush pm-download`. You may override this error by using the --pm-force option.
Available drush_invoke() hooks for pm-updatecode:
drush_pm_updatecode_pre_validate
drush_acapi_pm_updatecode_pre_validate
drush_archive_pm_updatecode_pre_validate
drush_cache_pm_updatecode_pre_validate
drush_cli_pm_updatecode_pre_validate
drush_config_pm_updatecode_pre_validate
drush_core_pm_updatecode_pre_validate
drush_docs_pm_updatecode_pre_validate
drush_druplicon_pm_updatecode_pre_validate
drush_field_pm_updatecode_pre_validate
drush_help_pm_updatecode_pre_validate
drush_helpsingle_pm_updatecode_pre_validate
drush_image_pm_updatecode_pre_validate
drush_init_pm_updatecode_pre_validate
drush_locale_pm_updatecode_pre_validate
drush_make_pm_updatecode_pre_validate
drush_notify_pm_updatecode_pre_validate
drush_outputformat_pm_updatecode_pre_validate
drush_policy_pm_updatecode_pre_validate
drush_queue_pm_updatecode_pre_validate
drush_registry_rebuild_pm_updatecode_pre_validate
drush_role_pm_updatecode_pre_validate
drush_runserver_pm_updatecode_pre_validate
drush_search_pm_updatecode_pre_validate
drush_shellalias_pm_updatecode_pre_validate
drush_site_install_pm_updatecode_pre_validate
drush_sitealias_pm_updatecode_pre_validate
drush_sql_pm_updatecode_pre_validate
drush_sqlsync_pm_updatecode_pre_validate
drush_ssh_pm_updatecode_pre_validate
drush_state_pm_updatecode_pre_validate
drush_topic_pm_updatecode_pre_validate
drush_usage_pm_updatecode_pre_validate
drush_user_pm_updatecode_pre_validate
drush_variable_pm_updatecode_pre_validate
drush_views_pm_updatecode_pre_validate
drush_watchdog_pm_updatecode_pre_validate
drush_xh_pm_updatecode_pre_validate
drush_pm_updatecode_validate [* Defined in /Users/XXX/work/PROJECT/website/vendor/drush/drush/commands/pm/pm.drush.inc]
drush_acapi_pm_updatecode_validate
drush_archive_pm_updatecode_validate
drush_cache_pm_updatecode_validate
drush_cli_pm_updatecode_validate
drush_config_pm_updatecode_validate
drush_core_pm_updatecode_validate
drush_docs_pm_updatecode_validate
drush_druplicon_pm_updatecode_validate
drush_field_pm_updatecode_validate
drush_help_pm_updatecode_validate
drush_helpsingle_pm_updatecode_validate
drush_image_pm_updatecode_validate
drush_init_pm_updatecode_validate
drush_locale_pm_updatecode_validate
drush_make_pm_updatecode_validate
drush_notify_pm_updatecode_validate
drush_outputformat_pm_updatecode_validate
drush_policy_pm_updatecode_validate [* Defined in /Users/XXX/.drush/policy.drush.inc]
Available rollback hooks for pm-updatecode:
drush_pm_updatecode_validate_rollback
drush_policy_pm_updatecode_validate_rollback
@weitzman is this in any way expected behaviour?
@tassoskoutlas Just a thought here, your policy function does not include an if statement to select when the policy should be applied. All the example policies do have an if statement that selects when it should be applied.
Make sure you are running your command from the /web dir or something below it. Or you can pass the --root option (or use a site alias). If you dont do those things then the /drush folder is not read and policy.drush.inc is not found.
Oh wait, you put it in ~/.drush. That should work, unless --local is specified in a drush.wrapper file, or in a site alias.
I thought I was having this problem as well because I was getting the "are you sure" prompt for the command even though I had a validate hook that prevented it. Turns out that Drush implements the validate hook to create that prompt and the drush implementation is invoked BEFORE mine. So once I select y/n to the prompt, then my validation hook runs as expected.
You could try using the pre-validate
hook if you wanted to come in prior to the prompt.
Hi,
As per instructions I have the following snippet
~/.drush/policy.drush.inc
file:When I am issuing a command like
drush sql-sync @self @some-remote-alias
the code never executes. I am using the policy file automatically generated by drupal-composer. It includespm-*
commands with deny messages that execute normally.Am I missing something?