when i run an action from my local machine on a remote website (using aliases) drush automatically responds Yes to the confirmation question

e.g. when I disable a module:

boris@bobuntu:~$ drush -vB @remsup dis webform
Load alias @remsup                                                                                                                                                                                [notice]
Begin redispatch via backend invoke                                                                                                                                                               [notice]
Initialized Drupal 6.20 root directory at /home/connexion/connexion.be/support                                                                                                                    [notice]
Initialized Drupal site support.connexion.be at sites/support.connexion.be                                                                                                                        [notice]
webform was disabled successfully.                                                                                                                                                             [ok]
Command dispatch complete                                                                                                                                                                         [notice]
The following extensions will be disabled: webform
Do you really want to continue? (y/n): y
Backend invoke is complete                                                                                                                                                                        [notice]

Drush doesnt stop at the prompt "Do you really want to continue? (y/n)" but continues and automatically responds "yes"

the same happens when i add the parameter "--no":
drush -vB @remsup en webform --no

the alias settings are:

$aliases['remsup'] = array(
  'root' => '/home/me/support',
  'uri' => 'support.example.com',
  'remote-host' => 'example.com',
  'remote-user' => 'example',
  'db_url' => 'mysql://exampleman:tadida@localhost/support',
  'path-aliases' => array(
    '%dump' => '/home/me/temp/drushdumps/support.sql',
    '%files' => '/home/me/support/files',
    '%drush-script' => '/home/me/drush/drush',
  )
);

Im using drush 4.4

CommentFileSizeAuthor
#4 backend-with-negative.patch1.01 KBgreg.1.anderson

Comments

greg.1.anderson’s picture

Version: All-versions-4.x-dev »

This is as designed, and is probably "won't fix" for 4.x. However, once #1058874: drush_backend_invoke buffers output till end of command. Show progress. is committed, we could conceivably work on making remote commands interactive. In fact, I believe that most remote commands are interactive with that patch, the one exception being core-cli, which hangs up for some reason.

I think there is probably some more work to be done in the area of remote interactive commands, though, so I'm going to leave this active for 5.x for now.

batigolix’s picture

ok, got it

i couldnt find any post about this on drupal.org so i hope this issue serves other users that consider this a problem

the automatic confirmation got me in trouble sometimes because i use the pm-update command to check which modules are enabled on the remote site

anyhow, thanks for the quick reply

greg.1.anderson’s picture

drush pm-list --status=enabled will do the trick.

I just noticed from your report above that the implicit --yes from --backend takes precedence over the --no from the command line. This is no good, and should be fixed in 5.x and 4.x.

greg.1.anderson’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.01 KB

--backend implies --yes, even if --no is explicitly included. This has very bad effects; for example:

drush @live pm-updatecode --no

Expected: Print the module status display and abort. Actual: runs the pm-updatecode!

This patch insures that --no takes precedence over --backend.

webkenny’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I can confirm this works on two drush installs so far.

greg.1.anderson’s picture

Version: » All-versions-4.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed. This is also important on the 4.x branch.

webkenny’s picture

FWIW, Greg, I tested this on a 4.x branch as well it seems to apply cleanly and work as expected. I assume nothing has changed in that area in the new version.

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Backported.

jonhattan’s picture

Status: Fixed » Patch (to be ported)

I was getting notice Use of undefined constant DRUSH_NEGATIVE - assumed 'DRUSH_NEGATIVE' environment.inc:685 [6.6 sec, 10.2 MB].

Fixed in http://drupalcode.org/project/drush.git/commit/19b33c9

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Good catch. Backported.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.