Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/scripts/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import util
import fire
import re
import psycopg

def create(db=None, User=None, Passwd=None, pg=None, spock=None, help=False):
"""
Expand Down
33 changes: 1 addition & 32 deletions cli/scripts/spock.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,36 +198,6 @@ def node_drop(node_name, db):
sys.exit(0)


def node_alter_location(node_name, location, db):
"""Set location details for spock node."""
pg_v,spock_v = get_spock_ver()

[location_nm, country, state, lattitude, longitude] = util.get_location_dtls(
location
)

sql = """
UPDATE spock.node
SET location_nm = ?, country = ?, state = ?, lattitude = ?, longitude = ?
WHERE location = ?
"""

con = util.get_pg_connection(pg_v, db, util.get_user())

rc = 0
try:
con = util.get_pg_connection(pg_v, "postgres", util.get_user())
cur = con.cursor(row_factory=psycopg.rows.dict_row)
cur.execute(sql, [location_nm, country, state, lattitude, longitude])
con.commit()
except Exception as e:
util.print_exception(e)
con.rollback()
rc = 1

sys.exit(rc)


def node_list(db):
"""Display node table.

Expand Down Expand Up @@ -726,7 +696,7 @@ def set_readonly(readonly="off"):

util.message("spock.set_readonly() deprecated, use db.set_readonly() instead", "warning")

return(db.set_readonly(readonly, pg))
return(db.set_readonly(readonly))


def get_pii_cols(db, schema=None):
Expand Down Expand Up @@ -1017,7 +987,6 @@ def metrics_check(db):
{
"node-create": node_create,
"node-drop": node_drop,
"node-alter-location": node_alter_location,
"node-list": node_list,
"node-add-interface": node_add_interface,
"node-drop-interface": node_drop_interface,
Expand Down
1 change: 0 additions & 1 deletion docs/cli_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Use commands in this section to invoke spock extension functionality with the CL
|---------|-------------|
| [spock node-create](functions/spock-node-create.md) | Define a node for spock. |
| [spock node-drop](functions/spock-node-drop.md) | Remove a spock node. |
| [spock node-alter-location](functions/spock-node-alter-location.md) | Set location details for spock node. |
| [spock node-list](functions/spock-node-list.md) | Display node table. |
| [spock node-add-interface](functions/spock-node-add-interface.md) | Add a new node interface. |
| [spock node-drop-interface](functions/spock-node-drop-interface.md) | Delete a node interface. |
Expand Down
11 changes: 0 additions & 11 deletions docs/functions/spock-node-alter-location.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/functions/spock.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
COMMAND is one of the following:
node-create # Define a node for spock.
node-drop # Remove a spock node.
node-alter-location # Set location details for spock node.
node-list # Display node table.
node-add-interface # Add a new node interface.
node-drop-interface # Delete a node interface.
Expand Down