Skip to content

Commit

Permalink
Remove role_key parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
  • Loading branch information
alinefm committed Jan 25, 2017
1 parent 649621f commit e24dfb5
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 34 deletions.
3 changes: 1 addition & 2 deletions control/cpuinfo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,7 +25,6 @@ class CPUInfo(Resource):
def __init__(self, model):
super(CPUInfo, self).__init__(model)
self.admin_methods = ['GET']
self.role_key = 'host'
self.uri_fmt = "/host/cpuinfo"

@property
Expand Down
3 changes: 1 addition & 2 deletions control/groups.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,4 +25,3 @@
class Groups(SimpleCollection):
def __init__(self, model):
super(Groups, self).__init__(model)
self.role_key = 'guests'
7 changes: 1 addition & 6 deletions control/host.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -30,7 +30,6 @@
class Host(Resource):
def __init__(self, model, id=None):
super(Host, self).__init__(model, id)
self.role_key = 'host'
self.admin_methods = ['GET', 'POST']
self.uri_fmt = '/host/%s'
self.devices = Devices(self.model)
Expand All @@ -46,7 +45,6 @@ def data(self):
class VolumeGroups(Collection):
def __init__(self, model):
super(VolumeGroups, self).__init__(model)
self.role_key = 'host'
self.uri_fmt = "/host/vgs"
self.admin_methods = ['GET']
self.resource = VolumeGroup
Expand All @@ -55,7 +53,6 @@ def __init__(self, model):
class VolumeGroup(Resource):
def __init__(self, model, id=None):
super(VolumeGroup, self).__init__(model, id)
self.role_key = 'host'
self.uri_fmt = "/host/vgs/%s"
self.admin_methods = ['GET']

Expand Down Expand Up @@ -89,7 +86,6 @@ def data(self):
class Partitions(Collection):
def __init__(self, model):
super(Partitions, self).__init__(model)
self.role_key = 'storage'
self.admin_methods = ['GET']
self.resource = Partition

Expand All @@ -112,7 +108,6 @@ def _get_resources(self, flag_filter):

class Partition(Resource):
def __init__(self, model, id):
self.role_key = 'storage'
self.admin_methods = ['GET']
super(Partition, self).__init__(model, id)

Expand Down
4 changes: 1 addition & 3 deletions control/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,15 +25,13 @@
class Interfaces(Collection):
def __init__(self, model):
super(Interfaces, self).__init__(model)
self.role_key = 'network'
self.admin_methods = ['GET']
self.resource = Interface


class Interface(Resource):
def __init__(self, model, ident):
super(Interface, self).__init__(model, ident)
self.role_key = 'network'
self.admin_methods = ['GET']
self.uri_fmt = "/interfaces/%s"

Expand Down
4 changes: 1 addition & 3 deletions control/networks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -39,7 +39,6 @@
class Networks(Collection):
def __init__(self, model):
super(Networks, self).__init__(model)
self.role_key = 'network'
self.admin_methods = ['POST']
self.resource = Network

Expand All @@ -51,7 +50,6 @@ def __init__(self, model):
class Network(Resource):
def __init__(self, model, ident):
super(Network, self).__init__(model, ident)
self.role_key = 'network'
self.admin_methods = ['PUT', 'POST', 'DELETE']
self.uri_fmt = "/networks/%s"
self.activate = self.generate_action_handler('activate')
Expand Down
3 changes: 1 addition & 2 deletions control/peers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,5 +25,4 @@
class Peers(SimpleCollection):
def __init__(self, model):
super(Peers, self).__init__(model)
self.role_key = 'peers'
self.admin_methods = ['GET']
4 changes: 1 addition & 3 deletions control/storagepools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -47,7 +47,6 @@
class StoragePools(Collection):
def __init__(self, model):
super(StoragePools, self).__init__(model)
self.role_key = 'storage'
self.admin_methods = ['POST']
self.resource = StoragePool
isos = IsoPool(model)
Expand Down Expand Up @@ -95,7 +94,6 @@ def _get_resources(self, filter_params):
class StoragePool(Resource):
def __init__(self, model, ident):
super(StoragePool, self).__init__(model, ident)
self.role_key = 'storage'
self.admin_methods = ['PUT', 'POST', 'DELETE']
self.uri_fmt = "/storagepools/%s"
self.activate = self.generate_action_handler('activate')
Expand Down
5 changes: 1 addition & 4 deletions control/storageservers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -26,15 +26,13 @@
class StorageServers(Collection):
def __init__(self, model):
super(StorageServers, self).__init__(model)
self.role_key = 'storage'
self.admin_methods = ['GET']
self.resource = StorageServer


class StorageServer(Resource):
def __init__(self, model, ident):
super(StorageServer, self).__init__(model, ident)
self.role_key = 'storage'
self.admin_methods = ['GET']
self.storagetargets = StorageTargets(self.model,
self.ident.decode("utf-8"))
Expand All @@ -47,7 +45,6 @@ def data(self):
class StorageTargets(Collection):
def __init__(self, model, server):
super(StorageTargets, self).__init__(model)
self.role_key = 'storage'
self.admin_methods = ['GET']
self.server = server
self.resource_args = [self.server, ]
Expand Down
4 changes: 1 addition & 3 deletions control/templates.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -40,7 +40,6 @@
class Templates(Collection):
def __init__(self, model):
super(Templates, self).__init__(model)
self.role_key = 'templates'
self.admin_methods = ['GET', 'POST']
self.resource = Template

Expand All @@ -52,7 +51,6 @@ def __init__(self, model):
class Template(Resource):
def __init__(self, model, ident):
super(Template, self).__init__(model, ident)
self.role_key = 'templates'
self.admin_methods = ['PUT', 'POST', 'DELETE']
self.uri_fmt = "/templates/%s"
self.clone = self.generate_action_handler('clone')
Expand Down
3 changes: 1 addition & 2 deletions control/users.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
# Copyright IBM Corp, 2015-2016
# Copyright IBM Corp, 2015-2017
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -26,7 +26,6 @@
class Users(SimpleCollection):
def __init__(self, model):
super(Users, self).__init__(model)
self.role_key = 'guests'

def get(self, filter_params):
res_list = []
Expand Down
4 changes: 0 additions & 4 deletions control/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class VMs(AsyncCollection):
def __init__(self, model):
super(VMs, self).__init__(model)
self.resource = VM
self.role_key = 'guests'
self.admin_methods = ['POST']

# set user log messages and make sure all parameters are present
Expand All @@ -63,7 +62,6 @@ def __init__(self, model):
class VM(Resource):
def __init__(self, model, ident):
super(VM, self).__init__(model, ident)
self.role_key = 'guests'
self.screenshot = VMScreenShot(model, ident)
self.virtviewerfile = VMVirtViewerFile(model, ident)
self.uri_fmt = '/vms/%s'
Expand Down Expand Up @@ -99,7 +97,6 @@ def data(self):
class VMScreenShot(Resource):
def __init__(self, model, ident):
super(VMScreenShot, self).__init__(model, ident)
self.role_key = 'guests'

def get(self):
self.lookup()
Expand All @@ -110,7 +107,6 @@ def get(self):
class VMVirtViewerFile(Resource):
def __init__(self, model, ident):
super(VMVirtViewerFile, self).__init__(model, ident)
self.role_key = 'guests'

@property
def data(self):
Expand Down

0 comments on commit e24dfb5

Please sign in to comment.