Skip to content

Commit df51adb

Browse files
authored
Merge pull request Juniper#20 from Juniper/remove_test_condition
JTAF 1.3 PR
2 parents bd92f6a + c267d6e commit df51adb

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
lines changed

Internal/processProviders/processProviders.go

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ func PrintHeader(message string) {
4343
// Node is a helper type for traversing the data tree.
4444
type Node struct {
4545
XMLName xml.Name
46-
Key string `xml:"name,attr"`
47-
Val string `xml:"value,attr"`
48-
Enums map[string]string `xml:"-"`
49-
Content []byte `xml:",innerxml"`
50-
Nodes []Node `xml:",any"`
46+
Key string `xml:"name,attr"`
47+
Val string `xml:"value,attr"`
48+
Content []byte `xml:",innerxml"`
49+
Nodes []Node `xml:",any"`
5150
}
5251

5352
// ElementName is a helper type for traversing the data tree.
@@ -149,7 +148,7 @@ func CreateProviders(jcfg cfg.Config) error {
149148
// Create list of yang files present
150149
listFiles(yangFilePath)
151150

152-
// Read data from file
151+
// Read data from xpath file
153152
datIn, err := ioutil.ReadFile(xpathFilePath)
154153
if err != nil {
155154
return err
@@ -216,30 +215,30 @@ func CreateProviders(jcfg cfg.Config) error {
216215
for _, v := range grpNode {
217216

218217
// fmt.Println("In file: ", inputYinFile)
219-
if v.Key == "control_route_filter_type" {
220-
// fmt.Println("looking for choice-ident")
221-
for _, v2 := range v.Nodes {
222-
if v2.Key == "choice-ident" {
223-
// fmt.Println("Found choice-ident...")
224-
for _, v3 := range v2.Nodes {
225-
// fmt.Println("looking for enumeration...")
226-
if v3.Key == "enumeration" {
227-
// fmt.Println("Found enumeration for choice-ident...")
228-
// fmt.Println("Length of enums: ", len(v3.Nodes))
229-
for _, v4 := range v3.Nodes {
230-
// fmt.Println(v4.Key)
231-
232-
if enums[v.Key] == nil {
233-
enums[v.Key] = make(map[string]string)
234-
}
235-
enums[v.Key][v4.Key] = v4.Key
236-
218+
// if v.Key == "control_route_filter_type" {
219+
// fmt.Println("looking for choice-ident")
220+
for _, v2 := range v.Nodes {
221+
if v2.Key == "choice-ident" {
222+
// fmt.Println("Found choice-ident...")
223+
for _, v3 := range v2.Nodes {
224+
// fmt.Println("looking for enumeration...")
225+
if v3.Key == "enumeration" {
226+
// fmt.Println("Found enumeration for choice-ident...")
227+
// fmt.Println("Length of enums: ", len(v3.Nodes))
228+
for _, v4 := range v3.Nodes {
229+
// fmt.Println(v4.Key)
230+
231+
if enums[v.Key] == nil {
232+
enums[v.Key] = make(map[string]string)
237233
}
234+
enums[v.Key][v4.Key] = v4.Key
235+
238236
}
239237
}
240238
}
241239
}
242240
}
241+
// }
243242
}
244243
// End of 'uses' enum processing for lists.
245244

Samples/tf_module_template/module/vsrx_1/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resource "junos-vsrx_InterfacesInterfaceUnitFamilyInetAddressName" "vsrx_2" {
2020
resource_name = "vsrx_2"
2121
name = "ge-0/0/0"
2222
name__1 = "0"
23-
name__2 = "10.0.0.0/24"
23+
name__2 = "10.0.0.1/24"
2424
}
2525

2626

cmd/processProviders/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ import (
2525
"github.com/Juniper/junos-terraform/Internal/processProviders"
2626
)
2727

28-
const _ver = "0.1.2"
28+
const _ver = "0.1.3"
2929

3030
// Syntactic helper to reduce repetition.
3131
func check(e error) {
3232
if e != nil {
33-
panic(e)
33+
fmt.Println(e)
34+
os.Exit(0)
3435
}
3536
}
3637

@@ -76,6 +77,7 @@ func main() {
7677
jcfg, err := cfg.GetConfig(*flagConfig)
7778
if err != nil {
7879
fmt.Println("Error retrieving configuration: ", err)
80+
os.Exit(0)
7981
}
8082

8183
PrintLogo()

cmd/processYang/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/Juniper/junos-terraform/Internal/processYang"
2626
)
2727

28-
const _ver = "0.1.2"
28+
const _ver = "0.1.3"
2929

3030
// Syntactic helper to reduce repetition.
3131
func check(e error) {

0 commit comments

Comments
 (0)