Skip to content

Commit 00fbada

Browse files
committed
Python: recognize fabric.operations
1 parent 21a0f8a commit 00fbada

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

python/ql/lib/semmle/python/frameworks/Fabric.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ private module FabricV1 {
2929
// -------------------------------------------------------------------------
3030
// fabric.api
3131
// -------------------------------------------------------------------------
32-
/** Gets a reference to the `fabric.api` module. */
33-
API::Node api() { result = fabric().getMember("api") }
32+
/** Gets a reference to the `fabric.api` module. Also known as `fabric.operations` */
33+
API::Node api() { result = fabric().getMember(["api", "operations"]) }
3434

3535
/** Provides models for the `fabric.api` module */
3636
module Api {

python/ql/test/library-tests/frameworks/fabric/fabric_v1_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@
1212
local(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
1313
run(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
1414
sudo(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
15+
16+
from fabric import operations
17+
18+
operations.local("cmd1; cmd2") # $getCommand="cmd1; cmd2"
19+
operations.local(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"

0 commit comments

Comments
 (0)