flex.py #37

  • //
  • guest/
  • netapp/
  • p4flexclone/
  • main/
  • demo/
  • flex.py
  • Commits
# Change User Description Committed
#37 18997 netapp Rename/move file(s)

Project name change:
moving
//guest/netapp/p4flexclone/main/…
to
//guest/netapp/p4flex/main/…
#36 15417 Paul Allen Remove client lock.
#35 15070 Paul Allen spelling
#34 15068 Paul Allen Allow locking on snapshot workspaces and use '-f' on volume delete.
#33 15067 Paul Allen Disable workspace locking for demo.

Better solution is for user 'flex' to delete with a '-f', but check ownership first.
#32 15066 Paul Allen Update create clone message.
#31 15065 Paul Allen Back out changelist 15064
#30 15064 Paul Allen chown fix?
#29 15063 Paul Allen Remove description from 'flex volumes' output.
#28 15062 Paul Allen Use Flex user to login current user (needs super)
Minor fix to help
#27 15027 agnesj Added a check if NetApp volume is mounted, removed test function, and modified -P to -S for flex clone command.
#26 14926 Paul Allen Move chown operations to method and use system call to 'chown -R'
#25 14925 Paul Allen Generate a P4CONFIG file in the mounted clone's volume.
#24 14924 Paul Allen Set workspace 'Root' to mount location for clone and snapshot.
#23 14923 Paul Allen Show Owner when listing clones and volume when listing snapshots.

Includes a tidy up on all listing commands.
#22 14921 Paul Allen #review-14917

Verify delete permission for volume/clone. 

 - Only a Perforce 'admin' can delete a volume
 - Only a Perforce 'admin' and the clone's owner can delete a clone.

Use Perforce client workspace based permissions to enforce rules.  If the client delete succeeds assume all is ok to delete the volume/clone.

Example error:

bob$ p4 flex clone -d clone_2_1_a
Locked client 'flexClone:clone_2_1_a' owned by 'pallen'; use -f to force update.
#21 14895 agnesj Modified volume function such that when creating a volume the owner of volume is modified.
Also modified vol_del and clone_del functions to check for ownership of volume.  Only owners of volumes are allowed to delete.
#20 14881 agnesj Added checks in chown and volume functions.
And added location of newly created volume in message.
#19 14180 Paul Allen Set file ownership for clone's mounted files.

 + Minor fix to clone delete
#18 14179 Paul Allen Add support for 'flex volumes' command.
#17 14178 agnesj Modified NetApp delete to check if volume is a root volume (vserver or node) and to not allow p4 user to delete.
#16 14141 agnesj Added definition functions for volume list, snapshot list based on volume name, all snapshot list, clone list
#15 13997 Paul Allen Stop on error (don't delete clients if vol delete fails).
#14 13996 Paul Allen Added -s to volume for size.
#13 13993 Paul Allen Added NetApp commands to Flex.

Example:

4007::ws$ p4 flex volume vol1
Created flex volume vol1

4007::ws$ p4 flex snapshot -V vol1 snapshot1
Created flex snapshot snapshot1

4007::ws$ p4 flex snapshot -V vol1 snapshot2
Created flex snapshot snapshot2

4007::ws$ p4 flex snapshots
snapshot vol1:snapshot1 root /home/pallen/flexclone/demo/ws
snapshot vol1:snapshot2 root /home/pallen/flexclone/demo/ws

4007::ws$ p4 flex clone -V vol1 -P snapshot1 clone_A
Created flex clone client flexClone:clone_A

4007::ws$ p4 flex clone -V vol1 -P snapshot1 clone_B
Created flex clone client flexClone:clone_B

4007::ws$ p4 flex clones
Clone clone_A root /home/pallen/flexclone/demo
Clone clone_B root /home/pallen/flexclone/demo

4007::ws$ p4 clients
Client flexClone:clone_A 2015/06/17 root /home/pallen/flexclone/demo 'Created by pallen. '
Client flexClone:clone_B 2015/06/17 root /home/pallen/flexclone/demo 'Created by pallen. '
Client flexSnap:vol1:snapshot1 2015/06/17 root /home/pallen/flexclone/demo/ws 'Created by flex. '
Client flexSnap:vol1:snapshot2 2015/06/17 root /home/pallen/flexclone/demo/ws 'Created by flex. '
Client pallen-ws 2015/06/10 root /home/pallen/flexclone/demo/ws 'Created by pallen. '

4007::ws$ p4 flex clone -d clone_B
Deleted Flex clone clone_B

4007::ws$ p4 flex clone -d clone_A
Deleted Flex clone clone_A

4007::ws$ p4 flex volume -d vol1
Deleted Flex volume vol1
   deleted client: flexSnap:vol1:snapshot1
   deleted client: flexSnap:vol1:snapshot2

4007::ws$ p4 clients
Client pallen-ws 2015/06/10 root /home/pallen/flexclone/demo/ws 'Created by pallen. '
#12 13988 Paul Allen Tidy up formatting and imports.
#11 13985 agnesj Added definitions: clone, snapshot, and delete
Modified test functions to test each of the added functions
#10 13867 agnesj Made corrections to NaFlex Class to pull info from flex.cfg file
#9 13859 Paul Allen Config details for cloud demo + NaServer test
#8 13796 Paul Allen Moved options to a configuration file.

 - The config file 'flex.cfg' MUST be located in the same dir as the script
 - Provided a sample 'in.txt' file to simulate a broker call (used for debug only)
#7 13791 Paul Allen Changed 'volume' to 'snapshot' and minor fix to for auth/login.
#6 13702 Paul Allen Added Permission check for p4 flex volume command.
#5 13671 Paul Allen Added '-a' option to flex clones command.

Tidy up and hide flexVol/flexClone prefix from user.
#4 13669 Paul Allen Added '-d' option to delete flex clone client.
#3 13668 Paul Allen Added Perforce functionality for volume(s) and clone(s) commands.
#2 13628 Paul Allen set executable
#1 13627 Paul Allen New Python script with Implemented help/usage