Hi Srini, There is no built-in way to do this yet. You can either see if 'kinit' has a form where you can provide the username and password as a commandline argument, or react to the prompt in some other way. One way is to use pexpect. I have wrapped this behavior in a module and explain how to use it in a blogpost: http://ilogue.com/jasper/blog/fexpect--dealing-with-prompts-in-fabric-with-pexpect/
Good luck, Jasper On 1 April 2012 02:50, Srivathsan Srinivas <[email protected]>wrote: > Hi, > I am a new user of Fabric and it is wonderful using it. I am now able > to login to a set of hosts and run some basic commands. However, I do not > know how to do the following: > - login to a set of hosts. (I can do this nicely) > - Once I am logged in to one of them, I have to : > a) do a "kinit <user-name>@<domain-name>.com" > b) This kerberos authentication will ask for a password > (different from login/ssh password). Fabric must enter this password and > enter.How to do this?? > > So, how do I do this kind of dual-layer login? An example script: > > > import sys > import time, string, datetime > import os.path > > from fabric.api import * > from fabric.operations import local, put > from apscheduler.scheduler import Scheduler > > from configobj import ConfigObj > from fabric.contrib.files import contains, exists, sed > > config = ConfigObj('./config.txt') > > def get_cred(): > env.password = config['test_pass'] > env.hosts = config['test_host'] > env.user = config['test_user'] > > def kinit_test(): > run('kinit [email protected]') > ????? I need to somehow supply the kerberos password here ???? > run('hadoop fs -count -q /user/srisrini') > > -- > Thanks, > Srini. <http://csc.lsu.edu/%7Essrini1/> > > _______________________________________________ > Fab-user mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/fab-user > > -- I'd love to see your attachment, but please use OpenDocument, not a proprietary format like docx. It's an international standard, endorsed by the EU, and implemented in many office suites, such as LibreOffice, and commercial products from Oracle, Sun, IBM and Microsoft (from 2007).
_______________________________________________ Fab-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/fab-user
