File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,6 @@ func dataSourceCloudstackVPC() *schema.Resource {
3737 Schema : map [string ]* schema.Schema {
3838 "filter" : dataSourceFiltersSchema (),
3939
40- "projectid" : {
41- Type : schema .TypeString ,
42- Optional : true ,
43- },
44-
4540 //Computed values
4641 "name" : {
4742 Type : schema .TypeString ,
@@ -71,6 +66,7 @@ func dataSourceCloudstackVPC() *schema.Resource {
7166 "project" : {
7267 Type : schema .TypeString ,
7368 Computed : true ,
69+ Optional : true ,
7470 },
7571
7672 "zone_name" : {
@@ -86,9 +82,12 @@ func dataSourceCloudstackVPC() *schema.Resource {
8682func datasourceCloudStackVPCRead (d * schema.ResourceData , meta interface {}) error {
8783 cs := meta .(* cloudstack.CloudStackClient )
8884 p := cs .VPC .NewListVPCsParams ()
89- if d .Get ("projectid" ) != "" {
90- p .SetProjectid (d .Get ("projectid" ).(string ))
85+
86+ // If there is a project supplied, we retrieve and set the project id
87+ if err := setProjectid (p , cs , d ); err != nil {
88+ return err
9189 }
90+
9291 csVPCs , err := cs .VPC .ListVPCs (p )
9392
9493 if err != nil {
You can’t perform that action at this time.
0 commit comments