FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| 
                    preparation:fhhome:test.py.html [2017/12/31 23:17] kurihara  | 
                
                    preparation:fhhome:test.py.html [2019/02/13 00:18] (current) kurihara  | 
            ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~NOTOC~~ | ||
| [[: | [[: | ||
| + | ====== $FHHOME/ | ||
| - | ====== $FHHOME/ | + | \\ | 
| + | {{INLINETOC}} | ||
| + | \\ | ||
| Line 14: | Line 16: | ||
| $ fab -l |grep test. # check options | $ fab -l |grep test. # check options | ||
| - | $ echo xx.xx.xx.xx | fab auth.test  | + | $ echo xx.xx.xx.xx | fab test.hostname | 
| - | $ fhghost.sh " | + | $ fhghost.sh " | 
| </ | </ | ||
| Line 22: | Line 24: | ||
| <sxh bash toolbar: | <sxh bash toolbar: | ||
| - | import sys | + | import sys, os | 
| from fabric.api import * | from fabric.api import * | ||
| from fabric.contrib import files | from fabric.contrib import files | ||
| + | from datetime import datetime | ||
| + | |||
| + | FHLINUX=os.environ[" | ||
| # test.local_hostname | # test.local_hostname | ||
| Line 37: | Line 42: | ||
| - | # test.cat_etc_shadow | + | # test.sudo | 
| @task | @task | ||
| - | def cat_etc_shadow(): | + | def sudo(): | 
| + |     """ | ||
|     sudo(' |     sudo(' | ||
| + | |||
| + | |||
| + | # test.arg1: | ||
| + | @task | ||
| + | def arg1(cmd): | ||
| + |     """ | ||
| + |     run(' | ||
| + | |||
| + | |||
| + | # test.arg2: | ||
| + | @task | ||
| + | def arg2(cmd1, cmd2): | ||
| + |     """ | ||
| + |     run(' | ||
| + |     run(' | ||
| + |     run(' | ||
| + | |||
| + | |||
| + | # test.put | ||
| + | @task | ||
| + | def put(): | ||
| + |     date = datetime.now().strftime(' | ||
| + |     local(' | ||
| + |     put('/ | ||
| + |     run(' | ||
| + |     run(' | ||
| + | |||
| + | # test.get | ||
| + | @task | ||
| + | def get(): | ||
| + |     date = datetime.now().strftime(' | ||
| + |     run(' | ||
| + |     get('/ | ||
| + |     local(' | ||
| + |     local(' | ||
| </ | </ | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.