Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7438401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:32:58+00:00 2026-05-29T10:32:58+00:00

Giving the following fabfile: from fabric.api import env, run env.user = ‘implicit_user’ env.hosts =

  • 0

Giving the following fabfile:

from fabric.api import env, run

env.user = 'implicit_user'
env.hosts = ['host1', 'explicit_user@host2', 'host3']

def print_user():
    with hide('running'):
        run('echo "%(user)s"' % env)

When we run fab print_user, we get:

[host1] out: implicit_user
[explicit_user@host2] out: explicit_user
[host3] out: implicit_user

Done.
Disconnecting from host1... done.
Disconnecting from host2... done.
Disconnecting from host3... done.

However, I would very much to conduct the entire fab print_user sequentially, with 10 second interval in between to make sure that the previous host is finished with its actions before the next host kicks the actions off:

[host1] out: implicit_user
<10 seconds here...>
[explicit_user@host2] out: explicit_user
<10 seconds here...>
[host3] out: implicit_user
<10 seconds here...>

Done.
Disconnecting from host1... done.
Disconnecting from host2... done.
Disconnecting from host3... done. 

Is there a way to do it? How should I tweak my fabfile to achieve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:32:59+00:00Added an answer on May 29, 2026 at 10:32 am

    Your file already executes sequentially unless you are specifying parallel via the command line. To be explicit about this sequential execution use the @serial decorator .

    Do you want this delay to deal with a failure? warn_only=False will cause a failure in one of your sequential tasks to terminate the task (other hosts will not run the task). This is also seen in the example below where as soon as false is run (it has failure exit status) the remaining host do not run the task.

    from fabric.api import *
    from fabric.decorators import hosts, parallel, serial
    import random
    
    @task
    @serial
    @with_settings(warn_only=False)
    def maybe_fail():
        if random.randint(0,3) == 0:
            run("/bin/false") 
        else:
            run("/bin/true")
    

    If you really want this 10 second delay I guess you could make a decorator that sleeps for 10 or just sleep at the end of your tasks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to uninstall an Assembly (log4net.dll) from GAC. It is giving following
When i am trying to run my program it is giving the following error
My xcode have crashed giving following error whenever I try to run my already
The latex file is giving the following error: ! LaTeX Error: File `datetime.sty' not
I am running valgrind as follows:- /usr/local/bin/valgrind process_name After excecution its giving me following
Why is the following code giving an exception? function SetText(index, text) { try {
The .NET Entity framework is giving me the following error: The table/view 'Foo.dbo.vwFoo' does
I am trying to connect to FBJS bridge. It keeps giving me the following
Eclipse is giving me a warning of the following form: Type safety: Unchecked cast
I have the following code and it is giving related to curly braces and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.