fog-proxmox 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +7 -0
  3. data/.travis.yml +1 -0
  4. data/.vscode/launch.json +3 -21
  5. data/.vscode/settings.json +7 -7
  6. data/Gemfile.lock +39 -39
  7. data/README.md +9 -2
  8. data/examples/compute.rb +20 -23
  9. data/examples/identity.rb +16 -21
  10. data/fog-proxmox.gemspec +1 -2
  11. data/lib/fog/compute/proxmox.rb +2 -8
  12. data/lib/fog/compute/proxmox/models/disk.rb +13 -11
  13. data/lib/fog/compute/proxmox/models/disks.rb +3 -5
  14. data/lib/fog/compute/proxmox/models/interface.rb +6 -11
  15. data/lib/fog/compute/proxmox/models/interfaces.rb +3 -5
  16. data/lib/fog/compute/proxmox/models/node.rb +38 -43
  17. data/lib/fog/compute/proxmox/models/nodes.rb +5 -11
  18. data/lib/fog/compute/proxmox/models/server.rb +123 -80
  19. data/lib/fog/compute/proxmox/models/server_config.rb +56 -24
  20. data/lib/fog/compute/proxmox/models/servers.rb +34 -26
  21. data/lib/fog/compute/proxmox/models/snapshot.rb +28 -14
  22. data/lib/fog/compute/proxmox/models/snapshots.rb +9 -17
  23. data/lib/fog/compute/proxmox/models/storage.rb +15 -11
  24. data/lib/fog/compute/proxmox/models/storages.rb +13 -22
  25. data/lib/fog/compute/proxmox/models/task.rb +10 -14
  26. data/lib/fog/compute/proxmox/models/tasks.rb +9 -18
  27. data/lib/fog/compute/proxmox/models/volume.rb +12 -12
  28. data/lib/fog/compute/proxmox/models/volumes.rb +10 -19
  29. data/lib/fog/compute/proxmox/requests/action_server.rb +1 -4
  30. data/lib/fog/compute/proxmox/requests/clone_server.rb +1 -4
  31. data/lib/fog/compute/proxmox/requests/create_backup.rb +1 -4
  32. data/lib/fog/compute/proxmox/requests/create_server.rb +1 -4
  33. data/lib/fog/compute/proxmox/requests/create_snapshot.rb +1 -4
  34. data/lib/fog/compute/proxmox/requests/create_spice.rb +1 -4
  35. data/lib/fog/compute/proxmox/requests/create_term.rb +1 -4
  36. data/lib/fog/compute/proxmox/requests/create_vnc.rb +1 -4
  37. data/lib/fog/compute/proxmox/requests/delete_server.rb +1 -4
  38. data/lib/fog/compute/proxmox/requests/delete_snapshot.rb +1 -4
  39. data/lib/fog/compute/proxmox/requests/get_node_statistics.rb +1 -4
  40. data/lib/fog/compute/proxmox/requests/get_server_config.rb +1 -4
  41. data/lib/fog/compute/proxmox/requests/get_server_status.rb +1 -4
  42. data/lib/fog/compute/proxmox/requests/{get_snapshot.rb → get_snapshot_config.rb} +5 -8
  43. data/lib/fog/compute/proxmox/requests/get_task.rb +1 -4
  44. data/lib/fog/compute/proxmox/requests/get_vnc.rb +1 -4
  45. data/lib/fog/compute/proxmox/requests/list_nodes.rb +1 -2
  46. data/lib/fog/compute/proxmox/requests/list_storages.rb +3 -1
  47. data/lib/fog/compute/proxmox/requests/log_task.rb +1 -4
  48. data/lib/fog/compute/proxmox/requests/move_disk.rb +1 -4
  49. data/lib/fog/compute/proxmox/requests/move_volume.rb +1 -4
  50. data/lib/fog/compute/proxmox/requests/next_vmid.rb +5 -3
  51. data/lib/fog/compute/proxmox/requests/resize_container.rb +1 -4
  52. data/lib/fog/compute/proxmox/requests/status_task.rb +1 -4
  53. data/lib/fog/compute/proxmox/requests/update_server.rb +1 -4
  54. data/lib/fog/identity/proxmox.rb +2 -8
  55. data/lib/fog/identity/proxmox/models/domain.rb +25 -21
  56. data/lib/fog/identity/proxmox/models/{ldap.rb → domain_type.rb} +9 -18
  57. data/lib/fog/identity/proxmox/models/domains.rb +6 -76
  58. data/lib/fog/identity/proxmox/models/group.rb +6 -19
  59. data/lib/fog/identity/proxmox/models/groups.rb +6 -12
  60. data/lib/fog/identity/proxmox/models/permission.rb +27 -31
  61. data/lib/fog/identity/proxmox/models/permissions.rb +8 -25
  62. data/lib/fog/identity/proxmox/models/pool.rb +9 -22
  63. data/lib/fog/identity/proxmox/models/pools.rb +7 -13
  64. data/lib/fog/identity/proxmox/models/principal.rb +1 -6
  65. data/lib/fog/identity/proxmox/models/role.rb +7 -20
  66. data/lib/fog/identity/proxmox/models/roles.rb +6 -13
  67. data/lib/fog/identity/proxmox/models/user.rb +7 -21
  68. data/lib/fog/identity/proxmox/models/users.rb +6 -12
  69. data/lib/fog/identity/proxmox/requests/check_permissions.rb +1 -4
  70. data/lib/fog/identity/proxmox/requests/list_roles.rb +0 -1
  71. data/lib/fog/identity/proxmox/requests/read_version.rb +1 -5
  72. data/lib/fog/identity/proxmox/requests/update_group.rb +2 -3
  73. data/lib/fog/identity/proxmox/requests/{add_permission.rb → update_permissions.rb} +4 -4
  74. data/lib/fog/network/proxmox/models/network.rb +12 -18
  75. data/lib/fog/network/proxmox/models/networks.rb +11 -17
  76. data/lib/fog/network/proxmox/models/node.rb +14 -10
  77. data/lib/fog/network/proxmox/models/nodes.rb +5 -11
  78. data/lib/fog/network/proxmox/requests/create_network.rb +1 -4
  79. data/lib/fog/network/proxmox/requests/delete_network.rb +1 -4
  80. data/lib/fog/network/proxmox/requests/get_network.rb +1 -4
  81. data/lib/fog/network/proxmox/requests/get_node.rb +1 -4
  82. data/lib/fog/network/proxmox/requests/power_node.rb +1 -4
  83. data/lib/fog/network/proxmox/requests/update_network.rb +1 -4
  84. data/lib/fog/{compute/proxmox/requests/check_vmid.rb → proxmox/attributes.rb} +9 -17
  85. data/lib/fog/proxmox/core.rb +2 -1
  86. data/lib/fog/proxmox/helpers/cpu_helper.rb +6 -3
  87. data/lib/fog/proxmox/helpers/disk_helper.rb +1 -1
  88. data/lib/fog/proxmox/helpers/nic_helper.rb +37 -22
  89. data/lib/fog/proxmox/version.rb +1 -1
  90. data/lib/fog/storage/proxmox.rb +1 -1
  91. data/spec/compute_spec.rb +64 -45
  92. data/spec/fixtures/proxmox/compute/containers.yml +1684 -4137
  93. data/spec/fixtures/proxmox/compute/identity_ticket.yml +4 -4
  94. data/spec/fixtures/proxmox/compute/nodes.yml +21 -21
  95. data/spec/fixtures/proxmox/compute/servers.yml +3065 -7741
  96. data/spec/fixtures/proxmox/compute/snapshots.yml +279 -827
  97. data/spec/fixtures/proxmox/compute/storages.yml +60 -21
  98. data/spec/fixtures/proxmox/compute/tasks.yml +56 -98
  99. data/spec/fixtures/proxmox/identity/auth.yml +6 -6
  100. data/spec/fixtures/proxmox/identity/domains.yml +252 -84
  101. data/spec/fixtures/proxmox/identity/groups.yml +93 -54
  102. data/spec/fixtures/proxmox/identity/identity_ticket.yml +4 -4
  103. data/spec/fixtures/proxmox/identity/permissions.yml +317 -79
  104. data/spec/fixtures/proxmox/identity/pools.yml +266 -71
  105. data/spec/fixtures/proxmox/identity/read_version.yml +6 -6
  106. data/spec/fixtures/proxmox/identity/roles.yml +96 -57
  107. data/spec/fixtures/proxmox/identity/users.yml +224 -107
  108. data/spec/fixtures/proxmox/network/identity_ticket.yml +4 -4
  109. data/spec/fixtures/proxmox/network/networks.yml +54 -95
  110. data/spec/helpers/nic_helper_spec.rb +4 -4
  111. data/spec/identity_spec.rb +38 -46
  112. data/spec/network_spec.rb +1 -1
  113. metadata +9 -23
  114. data/lib/fog/compute/proxmox/models/container.rb +0 -86
  115. data/lib/fog/compute/proxmox/models/container_config.rb +0 -114
  116. data/lib/fog/compute/proxmox/models/containers.rb +0 -43
  117. data/lib/fog/compute/proxmox/requests/get_node.rb +0 -44
  118. data/lib/fog/compute/proxmox/requests/get_storage.rb +0 -44
  119. data/lib/fog/identity/proxmox/models/activedirectory.rb +0 -57
  120. data/lib/fog/identity/proxmox/models/oath.rb +0 -50
  121. data/lib/fog/identity/proxmox/models/pam.rb +0 -46
  122. data/lib/fog/identity/proxmox/models/pve.rb +0 -46
  123. data/lib/fog/identity/proxmox/models/yubico.rb +0 -51
  124. data/lib/fog/identity/proxmox/requests/remove_permission.rb +0 -42
  125. data/lib/fog/proxmox/models/collection.rb +0 -85
  126. data/lib/fog/proxmox/models/model.rb +0 -58
@@ -17,98 +17,28 @@
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
- require 'fog/proxmox/models/collection'
21
20
  require 'fog/identity/proxmox/models/domain'
22
21
 
23
22
  module Fog
24
23
  module Identity
25
24
  class Proxmox
26
25
  # class Domains collection authentication
27
- class Domains < Fog::Proxmox::Collection
26
+ class Domains < Fog::Collection
28
27
  model Fog::Identity::Proxmox::Domain
29
28
 
30
- def to_domain(hash)
31
- realm = hash['realm']
32
- type_value = hash['type']
33
- tfa_value = hash['tfa']
34
- type_hash = hash.reject { |k, _v| %w[realm type tfa].include? k }
35
- type = to_type(type_value, type_hash)
36
- tfa = to_tfa(tfa_value)
37
- type.tfa = tfa if tfa
38
- new(realm: realm, type: type)
29
+ def all
30
+ load service.list_domains
39
31
  end
40
32
 
41
- def all(_options = {})
42
- load_response(service.list_domains, 'domains')
43
- end
44
-
45
- def find_by_id(id)
46
- response = service.get_domain(id)
47
- body = JSON.decode(response.body)
48
- data = body['data']
49
- data.store('realm', id)
50
- data.delete_if { |k, _v| k == 'digest' }
51
- to_domain(data)
33
+ def get(id)
34
+ all.find { |domain| domain.identity === id }
52
35
  end
53
36
 
54
37
  def destroy(id)
55
- domain = find_by_id(id)
38
+ domain = get(id)
56
39
  domain.destroy
57
40
  end
58
41
 
59
- def create(attributes = {})
60
- domain = new(realm: attributes[:realm])
61
- type_s = attributes[:type]
62
- tfa_s = attributes[:tfa]
63
- attr = attributes.reject { |k, _v| %i[realm type tfa].include? k }
64
- domain.type = to_type(type_s, attr)
65
- tfa = to_tfa(tfa_s)
66
- domain.type.tfa = tfa if tfa
67
- domain.create
68
- end
69
-
70
- def to_type(type, attributes)
71
- type_class(type).new(attributes)
72
- end
73
-
74
- def to_tfa(tfa_s)
75
- oath_rxp = /type=oath,step=(?<step>\d+),digits=(?<digits>\d+)/
76
- yubico_rxp = /type=yubico,id=(?<id>\w+),key=(?<key>\w+),url=(?<url>.+)/
77
- if oath_rxp.match(tfa_s)
78
- attributes = oath_rxp.named_captures
79
- type = 'oath'
80
- elsif yubico_rxp.match(tfa_s)
81
- attributes = yubico_rxp.named_captures
82
- type = 'yubico'
83
- end
84
- tfa_class(type).new(attributes) if type && attributes
85
- end
86
-
87
- def type_class(type)
88
- if type == 'pam'
89
- type_class = Fog::Identity::Proxmox::Pam
90
- elsif type == 'pve'
91
- type_class = Fog::Identity::Proxmox::Pve
92
- elsif type == 'ldap'
93
- type_class = Fog::Identity::Proxmox::Ldap
94
- elsif type == 'ad'
95
- type_class = Fog::Identity::Proxmox::Activedirectory
96
- else
97
- raise Fog::Proxmox::Errors::NotFound, 'domain type unknown'
98
- end
99
- type_class
100
- end
101
-
102
- def tfa_class(tfa)
103
- if tfa == 'oath'
104
- tfa_class = Fog::Identity::Proxmox::Oath
105
- elsif tfa == 'yubico'
106
- tfa_class = Fog::Identity::Proxmox::Yubico
107
- else
108
- raise Fog::Proxmox::Errors::NotFound, 'domain tfa unknown'
109
- end
110
- tfa_class
111
- end
112
42
  end
113
43
  end
114
44
  end
@@ -1,12 +1,3 @@
1
- # frozen_string_literal: true
2
- # Copyright 2018 Tristan Robert
3
-
4
- # This file is part of Fog::Proxmox.
5
-
6
- # Fog::Proxmox is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
1
  # Copyright 2018 Tristan Robert
11
2
 
12
3
  # This file is part of Fog::Proxmox.
@@ -26,21 +17,17 @@
26
17
 
27
18
  # frozen_string_literal: true
28
19
 
29
- require 'fog/proxmox/models/model'
30
-
31
20
  module Fog
32
21
  module Identity
33
22
  class Proxmox
34
23
  # class Group model authentication
35
- class Group < Fog::Proxmox::Model
24
+ class Group < Fog::Model
36
25
  identity :groupid
37
26
  attribute :comment
38
- def to_s
39
- groupid
40
- end
41
27
 
42
- def create(new_attributes = {})
43
- service.create_group(attributes.merge(new_attributes))
28
+ def save(options = {})
29
+ service.create_group(attributes.merge(options))
30
+ reload
44
31
  end
45
32
 
46
33
  def destroy
@@ -51,8 +38,8 @@ module Fog
51
38
 
52
39
  def update
53
40
  requires :groupid
54
- attr = attributes.reject { |key, _value| key == :groupid }
55
- service.update_group(groupid, attr)
41
+ service.update_group(identity, attributes.reject { |attribute| [:groupid].include? attribute })
42
+ reload
56
43
  end
57
44
  end
58
45
  end
@@ -17,31 +17,25 @@
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
- require 'fog/proxmox/models/collection'
21
20
  require 'fog/identity/proxmox/models/group'
22
21
 
23
22
  module Fog
24
23
  module Identity
25
24
  class Proxmox
26
25
  # class Groups authentication
27
- class Groups < Fog::Proxmox::Collection
26
+ class Groups < Fog::Collection
28
27
  model Fog::Identity::Proxmox::Group
29
28
 
30
- def all(_options = {})
31
- load_response(service.list_groups, 'groups')
29
+ def all
30
+ load service.list_groups
32
31
  end
33
32
 
34
- def find_by_id(id)
35
- cached_group = find { |group| group.groupid == id }
36
- return cached_group if cached_group
37
- group_hash = service.get_group(id)
38
- Fog::Identity::Proxmox::Group.new(
39
- group_hash.merge(service: service)
40
- )
33
+ def get(id)
34
+ all.find { |group| group.identity === id }
41
35
  end
42
36
 
43
37
  def destroy(id)
44
- group = find_by_id(id)
38
+ group = get(id)
45
39
  group.destroy
46
40
  end
47
41
  end
@@ -4,14 +4,6 @@
4
4
 
5
5
  # This file is part of Fog::Proxmox.
6
6
 
7
- # Fog::Proxmox is free software: you can redistribute it and/or modify
8
- # it under the terms of the GNU General Public License as published by
9
- # the Free Software Foundation, either version 3 of the License, or
10
- # (at your option) any later version.
11
- # Copyright 2018 Tristan Robert
12
-
13
- # This file is part of Fog::Proxmox.
14
-
15
7
  # Fog::Proxmox is free software: you can redistribute it and/or modify
16
8
  # it under the terms of the GNU General Public License as published by
17
9
  # the Free Software Foundation, either version 3 of the License, or
@@ -25,43 +17,47 @@
25
17
  # You should have received a copy of the GNU General Public License
26
18
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
27
19
 
28
- require 'fog/proxmox/models/model'
29
-
30
20
  module Fog
31
21
  module Identity
32
22
  class Proxmox
33
23
  # class Permission
34
- class Permission < Fog::Proxmox::Model
35
- attribute :type
36
- attribute :ugid
37
- attribute :roleid
38
- attribute :path
24
+ class Permission < Fog::Model
25
+ identity :type
26
+ identity :roleid
27
+ identity :path
28
+ identity :ugid
39
29
  attribute :propagate
40
30
 
41
- def to_s
42
- "path=#{path},roleid=#{roleid},type=#{type},ugid=#{ugid}"
31
+ def save
32
+ service.update_permissions(to_update)
43
33
  end
44
34
 
45
- def ==(other)
46
- to_s.eql? other.to_s if other
35
+ def destroy
36
+ service.update_permissions(to_update.merge(delete: 1))
47
37
  end
48
38
 
49
- def add
50
- service.add_permission(to_request)
51
- end
39
+ private
52
40
 
53
- def remove
54
- service.remove_permission(to_request)
41
+ def initialize_roles(new_attributes = {})
42
+ roles = new_attributes.delete(:roleid)
43
+ new_attributes.store(:roles, roles)
55
44
  end
56
45
 
57
- def to_request
58
- request = { roles: roleid, path: path, propagate: propagate }
59
- if type == 'group'
60
- request.store(:groups, ugid)
61
- elsif type == 'user'
62
- request.store(:users, ugid)
46
+ def initialize_ugid(new_attributes = {})
47
+ ugs = new_attributes.delete(:ugid)
48
+ if type === 'user'
49
+ new_attributes.store(:users, ugs)
50
+ elsif type === 'group'
51
+ new_attributes.store(:groups, ugs)
63
52
  end
64
- request
53
+ new_attributes.delete(:type)
54
+ end
55
+
56
+ def to_update
57
+ new_attributes = attributes.clone
58
+ initialize_roles(new_attributes)
59
+ initialize_ugid(new_attributes)
60
+ new_attributes
65
61
  end
66
62
  end
67
63
  end
@@ -17,43 +17,26 @@
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
- require 'fog/proxmox/models/collection'
21
20
  require 'fog/identity/proxmox/models/permission'
22
21
 
23
22
  module Fog
24
23
  module Identity
25
24
  class Proxmox
26
25
  # class Permissions authentication
27
- class Permissions < Fog::Proxmox::Collection
26
+ class Permissions < Fog::Collection
28
27
  model Fog::Identity::Proxmox::Permission
29
28
 
30
- def all(_options = {})
31
- load_response(service.list_permissions, 'permissions')
29
+ def all
30
+ load service.list_permissions
32
31
  end
33
32
 
34
- def create(permission_hash)
35
- groups = permission_hash[:groups]
36
- users = permission_hash[:users]
37
- roles = permission_hash[:roles]
38
- path = permission_hash[:path]
39
- propagate ||= 1
40
- permission = new(path: path, propagate: propagate, roleid: roles)
41
- if groups
42
- permission.type = 'group'
43
- permission.ugid = groups
44
- elsif users
45
- permission.type = 'user'
46
- permission.ugid = users
47
- end
48
- permission
33
+ def get(type, path, roleid, ugid)
34
+ all.find { |permission| permission.type === type && permission.path === path && permission.roleid === roleid && permission.ugid === ugid }
49
35
  end
50
36
 
51
- def add(permission)
52
- create(permission).add
53
- end
54
-
55
- def remove(permission)
56
- create(permission).remove
37
+ def destroy(permission_hash)
38
+ permission = new(permission_hash)
39
+ permission.destroy
57
40
  end
58
41
  end
59
42
  end
@@ -1,12 +1,3 @@
1
- # frozen_string_literal: true
2
- # Copyright 2018 Tristan Robert
3
-
4
- # This file is part of Fog::Proxmox.
5
-
6
- # Fog::Proxmox is free software: you can redistribute it and/or modify
7
- # it under the terms of the GNU General Public License as published by
8
- # the Free Software Foundation, either version 3 of the License, or
9
- # (at your option) any later version.
10
1
  # Copyright 2018 Tristan Robert
11
2
 
12
3
  # This file is part of Fog::Proxmox.
@@ -26,23 +17,18 @@
26
17
 
27
18
  # frozen_string_literal: true
28
19
 
29
- require 'fog/proxmox/models/model'
30
-
31
20
  module Fog
32
21
  module Identity
33
22
  class Proxmox
34
23
  # class Pool model of VMs
35
- class Pool < Fog::Proxmox::Model
24
+ class Pool < Fog::Model
36
25
  identity :poolid
37
26
  attribute :comment
38
27
  attribute :members
39
28
 
40
- def to_s
41
- poolid
42
- end
43
-
44
- def create(new_attributes = {})
45
- service.create_pool(attributes.merge(new_attributes))
29
+ def save(options = {})
30
+ service.create_pool(attributes.merge(options))
31
+ reload
46
32
  end
47
33
 
48
34
  def destroy
@@ -69,10 +55,11 @@ module Fog
69
55
 
70
56
  def update_with_member(member_name, member_id, delete = false)
71
57
  requires :poolid
72
- attr = attributes.reject { |key, _value| %i[poolid members].include? key }
73
- attr.store(member_name, member_id) if member_name
74
- attr.store('delete', 1) if delete
75
- service.update_pool(poolid, attr)
58
+ otpions = attributes.reject { |attribute| %i[poolid members].include? attribute }
59
+ otpions.store(member_name, member_id) if member_name
60
+ otpions.store('delete', 1) if delete
61
+ service.update_pool(poolid, otpions)
62
+ reload
76
63
  end
77
64
 
78
65
  def update
@@ -17,31 +17,25 @@
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
- require 'fog/proxmox/models/collection'
21
20
  require 'fog/identity/proxmox/models/pool'
22
21
 
23
22
  module Fog
24
23
  module Identity
25
24
  class Proxmox
26
25
  # class Pools Collection of pools of VMs
27
- class Pools < Fog::Proxmox::Collection
26
+ class Pools < Fog::Collection
28
27
  model Fog::Identity::Proxmox::Pool
29
28
 
30
- def all(_options = {})
31
- load_response(service.list_pools, 'pools')
29
+ def all
30
+ load service.list_pools
32
31
  end
33
-
34
- def find_by_id(id)
35
- cached_pool = find { |pool| pool.poolid == id }
36
- return cached_pool if cached_pool
37
- pool_hash = service.get_pool(id)
38
- Fog::Identity::Proxmox::Pool.new(
39
- pool_hash.merge(service: service)
40
- )
32
+
33
+ def get(id)
34
+ all.find { |pool| pool.identity === id }
41
35
  end
42
36
 
43
37
  def destroy(id)
44
- pool = find_by_id(id)
38
+ pool = get(id)
45
39
  pool.destroy
46
40
  end
47
41
  end
@@ -25,22 +25,17 @@
25
25
  # You should have received a copy of the GNU General Public License
26
26
  # along with Fog::Proxmox. If not, see <http://www.gnu.org/licenses/>.
27
27
 
28
- require 'fog/proxmox/models/model'
29
-
30
28
  module Fog
31
29
  module Identity
32
30
  class Proxmox
33
31
  # class Principal current user authenticated
34
- class Principal < Fog::Proxmox::Model
32
+ class Principal < Fog::Model
35
33
  identity :username
36
34
  attribute :password
37
35
  attribute :privs
38
36
  attribute :path
39
37
  attribute :otp
40
38
  attribute :realm
41
- def to_s
42
- username
43
- end
44
39
  end
45
40
  end
46
41
  end